Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 May 2007 10:44:58 +0200
From:      "=?ISO-8859-1?Q?Ahc=E8ne_Bendjoudi?=" <ahcene.bendjoudi@gmail.com>
To:        freebsd-amd64@freebsd.org
Subject:   relocation R_X86_64_32
Message-ID:  <8715bcff0705100144t52f2bbbbsa2efcb96d9bfe196@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8715bcff0705100144t52f2bbbbsa2efcb96d9bfe196>