This is the mail archive of the java@gcc.gnu.org mailing list for the Java 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: Problem with linking to shared native library


Andrew Haley schrieb:

Hi Andrew, thank you.

>  > My platform:
>  > - gcj version: 4.1.2 20061115
>  > - binutils version: 2.17.50.0.5 20060927
>  > - OS: openSUSE 10.2, Linux kernel 2.6.18.2-34-default
>  > - glibc version: 2.5 (20061011)
> 
> First thing:
> 
> gcj -shared -o"libSimpleCPPLib.so"  ./SimpleCPPLib.o   
> /usr/bin/ld: ./SimpleCPPLib.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
> ./SimpleCPPLib.o: could not read symbols: Bad value

I cannot reproduce this error message.

> /tmp/foo
> mkdir -p Debug/resource
> gcj  -O0 -g  "--classpath=./:"  -c de/dbt/simplelibclient/SimpleCPPLib.java -o de/dbt/simplelibclient/SimpleCPPLib.o
> de/dbt/simplelibclient/SimpleCPPLib.java:3: warning: The import de.dbt.simplelibclient is never used
>         import de.dbt.simplelibclient.*;
>                ^^^^^^^^^^^^^^^^^^^^^^
> 1 problem (1 warning)
> gcj  -O0 -g   --main=de.dbt.simplelibclient.SimpleCPPLib    de/dbt/simplelibclient/SimpleCPPLib.o  -oDebug/SimpleLibClient   -LDebug   -L/home/andreas/develop/projects/SimpleCPPLib/Debug -L../SimpleCPPLib/Debug -lSimpleCPPLib -lgcj 
> /tmp/foo

I also don't get this warning, even when using "-Wall".
My linker error is persistent.
In the meantime I built gcc/gcj from the 4.1.2 release sources and binutils from
the 2.17 release sources and I'm using them now, but the linker error is still
there.

What versions do you use?


-- 
Mit freundlichen Grueszen, / With kind regards,

  Andreas Bürgel
  Diplom-Informatiker (Ingenieur-Informatik)
  Software-Engineer/-Architect
  http://www.andreas-buergel.de/profile.html

  Unbedingt lesenswerte Site:
  http://www.nachdenkseiten.de


  Entia non sunt multiplicanda sine necessitate.
                            -- William of Ockham


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