RE: access from a dynamic library to the main-program

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If your library depends on symbols defined in your program (such as
callback functions, etc.), then you need to link your executable so that
it exports its symbols.  If you're using GNU binutils, you can do this
by adding the following command line parameter to your command line for
linking your executable:

-Wl,-E

For example:

gcc -Wl,-E -o myprogram <etc., etc.>

Thanks,
Lyle


-----Original Message-----
From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx] On
Behalf Of Thomas.Rogowski@xxxxxxxxxxx
Sent: Monday, November 29, 2004 1:49 PM
To: gcc-help@xxxxxxxxxxx
Subject: access from a dynamic library to the main-program

Hello!
I have a c++ program and a library separated in an executable and in a 
library file, the program loads the library dynamicaly and this library 
must have a pointer to my program.
How can I link and compile my library and my program? I use linux.
I tried to link program with library and library with program but after 
that I had two separated files and the library can't access to the 
instance of my program.

Thank you in advance
Thomas


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux