g++ can't locate dylib to link at

B

bowser

Hello,
I'm using g++ over eclipse in a mac os x. I'm new to all these
technologies.
I created a dylib, and to test it I made another project that links to
it, but the compiler tells me that it can't locate it.
In my last build I used absolute path to be sure of the location, but
it still delivers an error.
The output is:

**** Build of configuration Debug for project gnawa_tester ****

make -k all
Building target: gnawa_tester
Invoking: MacOS X C++ Linker
g++ `/Volumes/Quark/c++projects/wxconf-debug` -L/Volumes/Quark/c+
+projects/gnawax/gnawa_proj/build/Debug -o "gnawa_tester" ./
SynthetGUI.o ./main.o -llibgnawa_proj
/usr/bin/ld: can't locate file for: -llibgnawa_proj
collect2: ld returned 1 exit status
make: *** [gnawa_tester] Error 1
make: Target `all' not remade because of errors.
Build complete for project gnawa_tester

Any help? I'm stuck here for one day and a half..
Thank you in advance.
 
J

John Harrison

bowser said:
Hello,
I'm using g++ over eclipse in a mac os x. I'm new to all these
technologies.
I created a dylib, and to test it I made another project that links to
it, but the compiler tells me that it can't locate it.
In my last build I used absolute path to be sure of the location, but
it still delivers an error.
The output is:

**** Build of configuration Debug for project gnawa_tester ****

make -k all
Building target: gnawa_tester
Invoking: MacOS X C++ Linker
g++ `/Volumes/Quark/c++projects/wxconf-debug` -L/Volumes/Quark/c+
+projects/gnawax/gnawa_proj/build/Debug -o "gnawa_tester" ./
SynthetGUI.o ./main.o -llibgnawa_proj
/usr/bin/ld: can't locate file for: -llibgnawa_proj
collect2: ld returned 1 exit status
make: *** [gnawa_tester] Error 1
make: Target `all' not remade because of errors.
Build complete for project gnawa_tester

Any help? I'm stuck here for one day and a half..
Thank you in advance.

This is a group for C++, not a group about how to use your compiler or
build environment. You really should ask on a Mac programing group, and
eclipse group, even a g++ group but not here.

Now I'm not an expert on any of the things you are doing but if I were
you I'd try -lgnawa_proj not -llibgnawa_proj, it will only take you two
minutes to try, who knows it might even work. If it doesn't try a Mac
programming group. I think they would be best placed to help you.

john
 
B

bowser

ok, thanks and sorry for the inconvenience.
By the way, I've already tried the way you suggested, and also tried
with and without the extension.
 
B

bowser

Well, no, you were right!
Even if the library build name starts with "lib", I have to remove
that prefix in order to link it.
Before I tried to build it without that prefix.
Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top