Re: [jnc-users] RXTXcomm and JNC
Status: Beta
Brought to you by:
soapy
From: Marco T. <ma...@mt...> - 2009-06-29 10:10:48
|
Dear Mario Mario De Weerd wrote: > Hi > > I've almost built my opensource app 'BT747' using JNC after getting rid > of some unsupported method calls like String.format and > BufferedImage.getTransparency. > I am now at the final 'link'. I've used Proguard to get rid of most of > the rest. > > I get this kind of messages (I build using ant, so I use the > autocompiler, resulting in the '[exec prefixes]): > [exec] > C:/xxx/workspace/BT747/lib/RXTXcomm-win.jar.o:RXTXcomm.jar:(.text+0xdf2): > undefined reference to `java::lang::String* > gnu::io::CommPortIdentifier::native_psmisc_report_owner(java::lang::String*)' > [exec] > C:/xx/workspace/BT747/lib/RXTXcomm-win.jar.o:RXTXcomm.jar:(.text+0x26d4): > undefined reference to `void gnu::io::I2C::eventLoop()' > [exec] > C:/xxx/workspace/BT747/lib/RXTXcomm-win.jar.o:RXTXcomm.jar:(.text+0x2bee): > undefined reference to `int gnu::io::I2C::open(java::lang::String*)' > [exec] > C:/xxx/workspace/BT747/lib/RXTXcomm-win.jar.o:RXTXcomm.jar:(.text+0x2c52): > undefined reference to `void gnu::io::I2C::nativeSetI2CPortParams(int, > int, int, int)' So, are these native methods from classes in your jar? > I've set the java.library.path as this information line shows: > [exec] > -Djava.library.path=lib;C:\xxx\workspace\BT747\lib\rxtx-2.1-7-bins-r2\Windows\i368-mingw32 There's no need for a classpath for the compilation. It might even interfere with the proper compilation if something wrong is picked up. Please try without it. > I've tried both JNI and CNI. Maybe you first tried CNI and the compiled jar was cached. Then you changed to JNI (what would be correct) but the compiled jar with CNI was reused? This is of course just a guess. But if the undefined references are coming from your code, then this sounds plausible. Hope that helps Marco > Regarding the first link error, this is defined int he code as: > private native String native_psmisc_report_owner(String PortName); > > > I'll look further and I'll probably find it, but if somebody has the > anwser, it will surely save some time. > > Kind regads > > Mario > > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > javaCompiler-users mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/javacompiler-users |