Hello,
I am having difficulty linking using make created by Eclipse CDT.
My setup is the following:
- Mac Intel Code 2 Duo
- OS X 10.5.4 (fully patched)
- XCode 3.1
- Eclipse 3.4 (Ganymede) CDT
- Darwin ports 1.6.0
- cppunit 1.12.1
So cppunit libraries are located in /opt/local/lib/
and the header files are located in /opt/local/include
here is the result on the make session
**** Build of configuration Debug for project mycpptest ****
make all
Building file: ../src/main.cpp
Invoking: GCC C++ Compiler
g++ -I/opt/local/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/main.d" -MT"src/main.d" -o"src/main.o" "../src/main.cpp"
Finished building: ../src/main.cpp
Building target: mycpptest
Invoking: MacOS X C++ Linker
g++ -L/opt/local/lib -o "mycpptest" ./src/main.o -llibcppunit.a
ld: library not found for -llibcppunit.a
collect2: ld returned 1 exit status
make: *** [mycpptest] Error 1
The file libcppunit.a is really located in /opt/local/lib, I have verified.
I have tried multiple combinasons with the -L and -l parameters
with no success
For some reasons, the linker does not seems to like the library ???
Any suggestions ...
Thanks
Sylvain
PS: To validate the code and library I have created a project using XCode
and the file compile, link and run correctly.
I am having difficulty linking using make created by Eclipse CDT.
My setup is the following:
- Mac Intel Code 2 Duo
- OS X 10.5.4 (fully patched)
- XCode 3.1
- Eclipse 3.4 (Ganymede) CDT
- Darwin ports 1.6.0
- cppunit 1.12.1
So cppunit libraries are located in /opt/local/lib/
and the header files are located in /opt/local/include
here is the result on the make session
**** Build of configuration Debug for project mycpptest ****
make all
Building file: ../src/main.cpp
Invoking: GCC C++ Compiler
g++ -I/opt/local/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/main.d" -MT"src/main.d" -o"src/main.o" "../src/main.cpp"
Finished building: ../src/main.cpp
Building target: mycpptest
Invoking: MacOS X C++ Linker
g++ -L/opt/local/lib -o "mycpptest" ./src/main.o -llibcppunit.a
ld: library not found for -llibcppunit.a
collect2: ld returned 1 exit status
make: *** [mycpptest] Error 1
The file libcppunit.a is really located in /opt/local/lib, I have verified.
I have tried multiple combinasons with the -L and -l parameters
with no success
For some reasons, the linker does not seems to like the library ???
Any suggestions ...
Thanks
Sylvain
PS: To validate the code and library I have created a project using XCode
and the file compile, link and run correctly.