This is the mail archive of the gcc-help@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: Proglem making a lib for JNI


On 6 June 2011 22:02, kevin diggs wrote:
>
> I *think* you want something like:
>
> g++ -c -fPIC <blahx.cpp> <blahy.cpp> ...
> g++ -shared -oloibSM_Backend.so blahx.o blahy.o ...

You should use -fPIC on the second command too, the docs for -shared say:
For predictable results, you must also specify the same set of options
that were used to generate code (-fpic, -fPIC, or model suboptions)
when you specify this option.


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