This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Create an so file


> I'm working on SOLARIS machine, and i have a problem. So on trying to
> create the .so file with gcc command line, a fatal error was shown on the
> screen.
>
> Command lines :
>  > gcc -c -I"/sw/java/j2sdk/v1.4.2/j2sdk1.4.2/include/"
>  > -I"/sw/java/j2sdk/v1.4.2/j2sdk1.4.2/include/solaris" -o GenExt2FS.o
>  > GenExt2FS.c gcc -o GenExt2FS.so -shared GenExt2FS.o -lgcc
>
> The attached file contain the output of the second command.

Compile your source file with -fPIC.  And you probably don't need -lgcc.

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]