Re: How to make a program look for dylibs other than /usr/local/lib?
Re: How to make a program look for dylibs other than /usr/local/lib?
- Subject: Re: How to make a program look for dylibs other than /usr/local/lib?
- From: Greg Guerin <email@hidden>
- Date: Sat, 8 Dec 2007 11:41:30 -0700
parag vibhute wrote:
>printf("Timing=====%d\n",(*tm).month()); //header file CTime.h
>mentions to have void month() const; method of class CTime)
If month() returns void, what could %d print?
>/usr/bin/ld: Undefined symbols:
>OPT::CTime::month() const
>
>Please note I am not dynamic library(libopbx.dylib) creator & I am
>just using it.
The error from ld suggests that libopbx.dylib is not being linked against.
This is further confirmed by the absence of libopbx.dylib in the linkage
command-line:
>g++-4.0 -g -o test_i386 Testing.o -lstdc++ -fexception -arch i386
>-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
In an earlier post, you said you were using dlopen() to link to
libopbx.dylib at runtime, so it seems to me that something is inconsistent
here. It may be one of the following:
1) Testing.c doesn't actually call dlopen(), nor is it linked to
libopbx.dylib at link-time, in which case ld's error message is correct.
You should link to libopbx.dylib at link-time.
2) There is no month() method that returns void, but some declaration
declares that it is, and this is causing the mangled C++ name to be
incorrect. In that case, ld is correct: there is no month() method that
returns void. You should use the correct declaration for month(), which
probably returns int or short.
3) You haven't posted enough code to determine the problem. Please post a
well-isolated and working example that shows the problem, AND does
everything you say it should do, like using dlopen() to link to
libopbx.dylib.
For the "second scenario", you will have to explain what you want, not just
what you did. We can't tell what you want to happen in the second
scenario, because you've never said exactly what you want to happen. You
describe a complicated solution that sort of works, but that is not the
same as saying what you want to happen.
For example, if you want libopbx.dylib to remain at /usr/lib/libopbx.dylib,
you should say that. If you want it to be placed somewhere else, then say
that's what you want. If you want it relative to the program that refers
to it, then say that, and also re-read this post:
<http://lists.apple.com/archives/xcode-users/2007/Dec/msg00174.html>
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden