M
Manuel T
Hello everybody,
I'm trying to port a project from Windows+Cygwin to Linux(i'm working on a
Debian-like: Kubuntu), but I'm facing a lot of linking problems.
This project needs libraries xerces and gsl, more specifically libxerces-c,
libgsl, libgslblas. The project comes with an own makefile, automatically
generated by Eclipse cdt on Windows, on wich I made some change to fit it
for Linux.
Compilation step works fine, but when it tries to link tens of .o in an only
one binary, the following error occurs:
../src/utils/kinematic/Kinematics.o: In function
`Kinematics::getInvTransfMatrix(gsl_vector const*, unsigned int)':
Kinematics.cpp
.text+0x8d): undefined reference to
`DirKin::getInvTransfMatrix(gsl_vector const*, unsigned int)'
collect2: ld returned 1 exit status
make: *** [Puma200CS.exe] Error 1
But the above function doesn't come from any libraries. It's ust user
defined, so it appears in Eclipse's code completion.
How can I get rid of that?
Here is the linker section of the makefile:
****************************************************************
puma200CS: $(OBJS) $(USER_OBJS)
    @echo 'Building target: $@'
    @echo 'Invoking: GCC C++ Linker'
    g++ -L/usr/lib $(LIBS) $(OBJS) $(USER_OBJS) -o puma200CS
    @echo 'Finished building target: $@'
****************************************************************
where $OBJS is a list of tens of .o and $LIBS
is "-lgslcblas -lgsl -lxerces-c", without quotes, of course. Libraries are
correctly installed in /usr/lib, as you can see by -L linker's flag.
I've read somewhere that it's, maybe, a linking order question. I tried to
change the linking order, but no way to work.
Thanks a lot, in advance.
I'm trying to port a project from Windows+Cygwin to Linux(i'm working on a
Debian-like: Kubuntu), but I'm facing a lot of linking problems.
This project needs libraries xerces and gsl, more specifically libxerces-c,
libgsl, libgslblas. The project comes with an own makefile, automatically
generated by Eclipse cdt on Windows, on wich I made some change to fit it
for Linux.
Compilation step works fine, but when it tries to link tens of .o in an only
one binary, the following error occurs:
../src/utils/kinematic/Kinematics.o: In function
`Kinematics::getInvTransfMatrix(gsl_vector const*, unsigned int)':
Kinematics.cpp
`DirKin::getInvTransfMatrix(gsl_vector const*, unsigned int)'
collect2: ld returned 1 exit status
make: *** [Puma200CS.exe] Error 1
But the above function doesn't come from any libraries. It's ust user
defined, so it appears in Eclipse's code completion.
How can I get rid of that?
Here is the linker section of the makefile:
****************************************************************
puma200CS: $(OBJS) $(USER_OBJS)
    @echo 'Building target: $@'
    @echo 'Invoking: GCC C++ Linker'
    g++ -L/usr/lib $(LIBS) $(OBJS) $(USER_OBJS) -o puma200CS
    @echo 'Finished building target: $@'
****************************************************************
where $OBJS is a list of tens of .o and $LIBS
is "-lgslcblas -lgsl -lxerces-c", without quotes, of course. Libraries are
correctly installed in /usr/lib, as you can see by -L linker's flag.
I've read somewhere that it's, maybe, a linking order question. I tried to
change the linking order, but no way to work.
Thanks a lot, in advance.