relocation R_X86_64_32

Ahcène Bendjoudi ahcene.bendjoudi at gmail.com
Thu May 10 09:13:54 UTC 2007


Hello,

I want to comunicate between to applications (java/c++). So i made necessary
instructions, but when i tried to compile my code source with g++ it screen
this message This same code worked well on an other machine (intell) :

/-------------------
-bash-2.05b$ g++ -o libTest.so -shared Test.cpp
/usr/bin/ld: /tmp/ccUa8GTk.o: relocation R_X86_64_32 can not be used when
making a shared object; recompile with -fPIC
/tmp/ccUa8GTk.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
--------------------/
And when I recompiled with -fPIC :
/--------------------
-bash-2.05b$ g++ -o libTest.so -shared -fPIC Test.cpp
-bash-2.05b$ ls
Test.class Test.cpp Test.java  libTest.so  Test.h
--------------------/
So it seams that the libTest.so file was created, but when I tried to
execute it :
/------------------
-bash-2.05b$ java -Djava.library.path=. -classpath . Test
Exception in thread "main" java.lang.UnsatisfiedLinkError: no Test in
java.library.path
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
        at java.lang.Runtime.loadLibrary0(Runtime.java:822)
        at java.lang.System.loadLibrary(System.java:992)
        at Test.<clinit>(Test.java:3)
--------------------/
some one can solve this

Thanks in advance
Ahcene


More information about the freebsd-amd64 mailing list