This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs & Dynamic Libraries
- To: Richard Henderson <rth at cygnus dot com>
- Subject: Re: egcs & Dynamic Libraries
- From: Jean-Michel Paris <Jean-Michel dot Paris at pt dot nce dot sita dot int>
- Date: Fri, 16 Oct 1998 11:07:33 +0200
- Cc: Jean-Michel Paris <Jean-Michel dot Paris at pt dot nce dot sita dot int>, egcs at cygnus dot com
- Organization: SITA
- References: <36236CCC.21C60B31@pt.nce.sita.int> <19981015154237.A23245@dot.cygnus.com>
Richard Henderson wrote:
> > 3°/ How can I write the compilation command to produce the desired
> > executable.
>
> Um, like using any other library? What are you asking?
>
> r~
Sorry, Let's see at a complete example:
I define a *great* class: A.
A::A()
{
cout << "A::A()" << endl ;
}
>g++ -c -g -fpic A.cpp
>g++ -g -shared -o A.so A.o (2)
An *amazing* main.
int main ()
{ A a ;}
>g++ -c -g -fpic main.cpp
>g++ -g -o main main.o A.so (4)
I set LD_LIBRARY_PATH, to use the current dir.
And... all works fine !
>./main
A
Althrough the things are alrights, maybe I've miss some compiler options !
Should I add the -fpic flag at the (2) & (4) compilation lines ?
It works whether I set it or not.
--
Jean-Michel Paris - Software Engineer
SITA Group http://www.sita.int
Internetworking Products & Services Program
Bât Héraklion - 1041 Route des Dolines
Sophia Antipolis
06560 VALBONNE - FRANCE
mailto:Jean-Michel.Paris@pt.nce.sita.int
http://www.mygale.org/07/jmparis (Most Recent Update: 13 August 1998)