egcs & Dynamic Libraries
Jean-Michel Paris
Jean-Michel.Paris@pt.nce.sita.int
Fri Oct 16 07:00:00 GMT 1998
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)
More information about the Gcc
mailing list