Problem with linking to shared native library
Andreas Bürgel
Andreas.Buergel@web.de
Mon Mar 5 20:51:00 GMT 2007
Sorry for the inconvenience, new installed mailer ...
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
I've attached the example C++ lib and the Java class using the lib. Just unpack
the archive simplecpplib_sample.tar.bz2 in an empty dir and run "build.sh".
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)
I took into consideration doing something really stupid, but I don't see it.
Thanks in advance for any help.
--
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simplecpplib_sample.tar.bz2
Type: application/x-bzip
Size: 5502 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20070305/16272248/attachment.bin>
More information about the Java
mailing list