This is the mail archive of the
mailing list for the GCC project.
Re: GCC compile error message....
- To: <yasar dot karadeli at turkcell dot com dot tr>
- Subject: Re: GCC compile error message....
- From: Jack Lloyd <lloyd at acm dot jhu dot edu>
- Date: Mon, 20 Aug 2001 06:36:57 -0400 (EDT)
- Cc: <gcc at gcc dot gnu dot org>
> Hi ,
> I want to help us about compiling my program. GCC is used to compile the
> I used java JNI(java native interface) to developt the program.
> Our platform is HP Unix 11.0, gcc version 2.95.2 19991024 (release).
> The program is a shared library (.sh). To do, I use a makefile.
> The program(shared library) use some C API library. When I add the C
> API library in makefile, I take a compile error.
> The compile error :
> /bin/ld: DP relative code in file .../bin/libProvisioningAPI.sl - shared
> library must be position
> independent. Use +z or +Z to recompile.
> What can I do to fix the error ? I used +z option to compile my program
> with gcc, but gcc has no
> +z option.
You want -fpic or -fPIC. +z is HP cc's option for generating position
independent code. Add -fpic or -fPIC (try -fpic first, if you run into
troubles, try -fPIC) to your makefile arguments, so that all the objects
which are included in the shared lib are compiled with this option.