Re: warning can't open dynamic library:
Re: warning can't open dynamic library:
- Subject: Re: warning can't open dynamic library:
- From: Kevin Grant <email@hidden>
- Date: Thu, 22 Jan 2004 22:50:12 -0600
This is driving me crazy! I keep getting the following error:
ld: warning can't open dynamic library: /usr/local/lib/FooBar.dylib
(checking for undefined symbols may be affected) (No such file or
directory, errno = 2)
ld: Undefined symbols:
And then a list of symbols in the FooBar library. The problem is,
libFooBar.a is not a dylib, it is a static library. The other problem
is, libFooBar.a isn't even in the project anymore. In or out of the
project it doesn't seem to matter, I always get the same error.
This is what happened. FooBar used to be a dylib, but I then
recompiled it as a static library, libFooBar.a. After removing
libFooBar.dylib from the project and adding the static one I keep
getting this error. And why would it be looking for libFooBar.dylib
in /usr/local/lib anyway? . . . .
If you only use "-l" to refer to an object, it will implicitly be
static or shared depending on what the most recent preceding "-static"
or "-shared" option is on the command line; if none, it probably
defaults to shared.
Normally these options can be used for precise control, but the man
page implies Mac OS X only supports them if ALL your libraries are
static, or they are all shared. Anyway, you might try -static.
Check the build window in Xcode, bottom half, to see the raw compiler
output and the options generated. And modify the compiler flags in a
target or project inspector to fix 'em if they're wrong.
Yet another option is to just *list* "libFooBar.a" as one of your
object files. The downside is that the linker won't know it is a
library, so it has no opportunity to strip out code that is not
actually used; but it should work.
Hope this helps,
Kevin G.
http://homepage.mac.com/kmg/
mail to kevin at ieee dot org
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.