Hi, Thanks guys I think that was the solution I used the same object files, just compiled it into a lib specially for JNI as follows: $(CXX) -o $(CFG)/libjavaapi.so -O0 -g3 -Wall -fmessage-length=0 $(ALLOBJS) $(CFG)/javaapi.obj -fPIC -shared -rdynamic Thanks for the help Robert Jonathan Wakely-4 wrote: > > 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. > > -- View this message in context: http://old.nabble.com/Proglem-making-a-lib-for-JNI-tp31777880p31794201.html Sent from the gcc - Help mailing list archive at Nabble.com.