This is the mail archive of the gcc@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]

Re: GCC compile error message....


> Hi ,
>
> I want to help us about compiling my program. GCC is used to compile the
> program.
> 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.

Regards,

Jack


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