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]

CNI linking errors


hi, i got the following errors, trying to compile the test programm from the faq. i applied a patch from the mailing lists. still the same thing. what can be wrong?
i'm using following version: 3.0.2-0pre011014

-----------------------------------OUTPUT---------------------------------------------------
gcj -C sample.java
gcj -c sample.class
gcjh sample
g++ -c sampNat.cc
In file included from /usr/include/java/lang/Object.h:16,
                 from /usr/include/gcj/cni.h:16,
                 from sampNat.cc:1:
/usr/include/gcj/javaprims.h:368: warning: `__malloc__' attribute directive ignored
/usr/include/gcj/javaprims.h:370: warning: `__malloc__' attribute directive ignored
/usr/include/gcj/javaprims.h:372: warning: `__malloc__' attribute directive ignored
/usr/include/gcj/javaprims.h:377: warning: `__malloc__' attribute directive ignored
/usr/include/gcj/javaprims.h:382: warning: `__malloc__' attribute directive ignored
g++ -c sampSTL.cc
gcj -o sample sample.o sampNat.o sampSTL.o -lstdc++ --main=sample
sample.o: In function `sample::myJava(java::lang::String*)':
/home/flo/project/jcgi/sample.class(.data+0xc): undefined reference to `sample::myNative(java::lang::String*)'
/home/flo/project/jcgi/sample.class(.data+0x5c): undefined reference to `sample::myNative(java::lang::String*)'
sampNat.o: In function `sample::myNative(java::lang::String *)':
sampNat.o(.text+0x15): undefined reference to `java::lang::System::out'
sampNat.o(.text+0x24): undefined reference to `java::lang::System::out'
sampSTL.o: In function `callSTLcode(void)':
sampSTL.o(.text+0xa): undefined reference to `endl(ostream &)'
sampSTL.o(.text+0x17): undefined reference to `cout'
sampSTL.o(.text+0x1c): undefined reference to `ostream::operator<<(char const *)'
sampSTL.o(.text+0x27): undefined reference to `ostream::operator<<(ostream &(*)(ostream &))'
collect2: ld returned 1 exit status
make: *** [sample] Error 1


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