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


Andreas Bürgel schrieb:
> I've got a linking problem. Referencing a native C++ method in an shared library
> causes this error:
> 
> 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
> de/dbt/simplelibclient/SimpleCPPLib.o:(.data+0xc): undefined reference to
> `hidden alias for de::dbt::simplelibclient::SimpleCPPLib::square(int)'
> de/dbt/simplelibclient/SimpleCPPLib.o:(.data+0x68): undefined reference to
> `hidden alias for de::dbt::simplelibclient::SimpleCPPLib::square(int)'
> collect2: ld returned 1 exit status

In the meantime I tested with a gcc 4.0.4 built from the release sources. With
this gcc version the executable builds fine without errors and runs as expected.
The other parts of my environment didn't change, so this looks like a problem of
gcc version > 4.0.4
I attached my current example also containing the output of failure build with
"gcc/gcj -v" (4.1.2) and "nm -C" of the shared lib.

-- 
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

Attachment: simplecpplib_sample.tar.bz2
Description: application/bzip


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