[prev in list] [next in list] [prev in thread] [next in thread] 

List:       rxtx
Subject:    Re: [Rxtx] problem compiling CNI tree
From:       Trent Jarvi <taj () linuxgrrls ! org>
Date:       2003-09-05 17:55:29
[Download RAW message or body]



On Fri, 5 Sep 2003, Gert-Jan van der Heiden wrote:

> Hello,
> 
> I'm trying to compile the CNI library and sample application on Linux. 
> Compiling the libs seam so go OK, I see the resulting librxtx-0.0-1.so. But 
> compiling the "Simple" sample application goes wrong. It complains about 
> "undefinded reference to '.L222' " The README in this directory explains that 
> it means I'm missing a library, but I don't know which one that should be. I 
> have the basic libz, libdl, libgcj and libthread.
> 
> $gcj --version
> gcj (GCC) 3.3 20030226 (prerelease) (SuSE Linux)
> Copyright (C) 2002 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> $make
> rm -f Simple.java
> gcj -d . -C *.java
> for i in gnu/io/*.class;do gcjh -d . `echo $i|sed s/.class//g`;done
> jar -cf RXTX.jar gnu/io/*.class
> g++ -Wall -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -O2 
> -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -I . -c SerialImp.c
> SerialImp.c: In member function `void
>    gnu::io::RXTXPort::writeArray(JArray<jbyte>*, __java_int, __java_int,
>    __java_boolean)':
> SerialImp.c:1369: warning: label `fail' defined but not used
> g++ -Wall -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -O2 
> -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -I . -c fuserImp.c
> (cd gnu/io && gcj -g -classpath ../.. -d gnu/io -c *.class )
> g++ -g -shared gnu/io/*.o *.o -lpthread  -Wl,-soname -Wl,librxtx-0.0-1.so -o 
> librxtx-0.0-1.so
> rm -f librxtx.so && ln -s librxtx-0.0-1.so librxtx.so
> ar rs librxtx.a  gnu/io/*.o *.o
> #gcj *.o librxtx.a -static  -lgcj -lpthread -ldl -lz -o Simple --main=Simple
> ln -s Simple.Java Simple.java
> gcj --classpath RXTX.jar  -d . -C Simple.java
> rm Simple.java
> gcj -g -classpath RXTX.jar -d . -c Simple.class
> gcj -g *.o gnu/io/*.o -static  -lgcj -lpthread -ldl -lz -o Simple 
> --main=Simple
> gnu/io/RXTXPort.o(.text+0xa1f): In function `gnu::io::RXTXPort::sendEvent(int, 
> bool)':
> /home/gertjan/build/rxtx-2.1-7pre16/CNI/gnu/io/gnu/io/RXTXPort.java:613: 
> undefined reference to `.L222'
> collect2: ld returned 1 exit status
> make: *** [Simple] Fout 1
> 
> 

The errors I saw while making the commetn in README had real function 
names.  The error above is probably an error lower than what I was seeing.
Something is probably wrong with your toolchain.  I just checked with the 
CVS CNI (in the 2.1 tree) and things are still compiling fine here:

[root@servertrent CNI]# make
rm -f Simple.java
gcj -d . -C *.java
for i in gnu/io/*.class;do gcjh -d . `echo $i|sed s/.class//g`;done
jar -cf RXTX.jar gnu/io/*.class
g++ -Wall -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -O2 
-D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -I . -c SerialImp.c
SerialImp.c: In member function `void 
   gnu::io::RXTXPort::writeArray(JArray<jbyte>*, __java_int, __java_int, 
   __java_boolean)':
SerialImp.c:1369: warning: label `fail' defined but not used
g++ -Wall -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -O2 
-D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -I . -c fuserImp.c
(cd gnu/io && gcj -g -classpath ../.. -d gnu/io -c *.class )
g++ -g -shared gnu/io/*.o *.o -lpthread  -Wl,-soname -Wl,librxtx-0.0-1.so 
-o librxtx-0.0-1.so
rm -f librxtx.so && ln -s librxtx-0.0-1.so librxtx.so
ar rs librxtx.a  gnu/io/*.o *.o
#gcj *.o librxtx.a -static  -lgcj -lpthread -ldl -lz -o Simple 
--main=Simple
ln -s Simple.Java Simple.java
gcj --classpath RXTX.jar  -d . -C Simple.java
rm Simple.java
gcj -g -classpath RXTX.jar -d . -c Simple.class
gcj -g *.o gnu/io/*.o -static  -lgcj -lpthread -ldl -lz -o Simple 
--main=Simple
[root@servertrent CNI]# ./Simple 
Getting PortIdentifiers
Devel Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
writing output
Got Data Available
Printing read() results
123456789
[root@servertrent CNI]# gcc --version
gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.

[root@servertrent CNI]# gcj --version
gcj (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
PURPOSE.

[root@servertrent CNI]# rpm -q gcc gcc-java
gcc-3.2-7
gcc-java-3.2-7

_______________________________________________
Rxtx mailing list
Rxtx@linuxgrrls.org
http://hex.linuxgrrls.org/mailman/listinfo/rxtx
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic