By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,408 Members | 945 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,408 IT Pros & Developers. It's quick & easy.

g++ can't locate dylib to link at

P: n/a
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.

Mar 10 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
bowser wrote:
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
Mar 10 '07 #2

P: n/a
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.

Mar 10 '07 #3

P: n/a
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!

Mar 10 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.