This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: dlopen issues
- From: Gaurav Jain <gaurav dot anywhere at gmail dot com>
- To: Mohit Kumar <mohit dot kumar at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 8 Jun 2005 16:43:31 +0530
- Subject: Re: dlopen issues
- References: <56c2ab6805060800185ed63456@mail.gmail.com>
- Reply-to: Gaurav Jain <gaurav dot anywhere at gmail dot com>
Make sure that libsane.so is available to Trydll.out during run-time.
Does your LD_LIBRARY_PATH have the location of libsane.so?
On 6/8/05, Mohit Kumar <mohit.kumar@gmail.com> wrote:
> Hi All,
>
> I am not aware if this is the correct mailing list to put this
> question at, but guess it could be a starting point. If you feel there
> is a relevant mailing list for this question, I request you to forward
> it to the proper mailing list.
>
> I have a self made shared library libXYZ.so which inturn has
> references to libsane.so.
>
> I need to dlopen into libXYZ.so. To resolve dependency on libsane.so,
> my program say Trydll.out is bult with -lsane option (for libsane.so).
> However I get an unresolved symbol for all variable of types defined
> in libsane.so.
>
> To be exact,
>
> libXYZ.so has declarations like:
> class CSane
> {
> public:
> static SANE_Handle handle; //SANE_Handle is got from libsane.so
> }
>
> in Trydll.cpp i have written
>
> int main(void)
> {
> void * lib_handle = ("path of libXYZ.so",RTLD_LAZY);
> }
>
> This returns me null saying undefined symbol to CSane::handle.
>
> What am I doing wrong here? Any help would be higle appreciable.
>
> Thanks,
> Mohit
>