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

List:       rxtx
Subject:    Re: [Rxtx] Application working under linux and OSX, problems with
From:       Trent Jarvi <taj () linuxgrrls ! org>
Date:       2003-08-01 16:44:17
[Download RAW message or body]



On Wed, 30 Jul 2003, Mary Pietrowicz wrote:

> Hi,
> 
> I've been using rxtx 2.1.x to talk to RFID readers in Linux and OSX 
> environments.  I would like to use rxtx 2.1 with my application (same code) 
> on Windows.  I have also run the my app successfully on Windows with Sun's 
> comm package, but I would like to keep a common code base and use 
> rxtx.  Here is what I have tried sofar to get things running with rxtx on 
> windows (below).  Any help would be greatly appreciated!
> 
> Attempted to build 2.1.6 with lcc (one of the build options in the 
> installation instructions).  Could not get a successful compile.
> 
> When I noticed that all of the Windows prereleases had been built with 
> mingw, I switched to those build tools and installed MinGW@-3.0.0-rc3, 
> gcj-3.2-20021210-1, MSYS-1.0.10-rc-1.
> 
> I'm using jdk1.4.1-b21.  No comm.jar in lib\ext.  :-)
> 
> I'm running Windows XP.
> 
> I attempted to build rxtx 2.1.6 from within cygwin, since that is what I 
> already had in my Windows environment.  Makefile is attached.  In my first 
> build attempt (ran make per instructions), I got
> ../src/SerialImp.c:22:20:config.h: No such file or directory.  Then, I did 
> a "make include/config.h" to produce the config.h file.
> 
> At the next attempt, the libgcj-config file could not be found.  I copied 
> d:\mingw
> lib\gcc-lib\mingw32\3.2\include\gcj\libgcj-config.h to d:\mingw\include\gcj 
> where it could be found.   I ran "make", no errors.  Then I did a "make 
> install".  The build process asked to copy *.c and *.java files back into 
> .../build/gnu/io, compiled everything again, overwrote Serial.def again, 
> and then copied out RXTXcomm.jar and rxtxSerial.dll.  No errors.  I rebuilt 
> my java source, and ran it from the DOS shell.  I got the following runtime 
> error:
> 
> Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D401C0E
> Function=JVM_RegisterUnsafeMethods+0x18C
> Library=d:\j2sdk1.4.1\jre\bin\client\jvm.dll
> 
> Current Java thread:
> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method)
> at gnu.io.RXTXCommDriver.<clinit>(RXTXCommDriver.java:56)
> at java.lang.Class.forName0<NativeMethod>
> at Java.lang.Class.forName(Class.java:140)
> at gnu.io.CommPortIdentifier<clinit>(CommPortIdentifier.java:67)
> .... Stack trace calls from my code from here
> 
> Error file hs_err_pid2244.log is attached.
> 
> I thought I might have better luck building from the MSYS shell using the 
> same Makefile.  So, I cleaned everything out, and did a "make 
> include/config.h", a "make", and a "make install".   I got a build - no 
> errors - rebuilt my code again from scratch, and ran  it from the DOS 
> shell.  I got a related runtime error:
> java.lang.UnsatisfiedLinkError:  nativeGetVersion thrown while loading 
> gnu.io.RXTXCommDriver
> 
> I also tried the prebuilt prerelease.
> 
> (From ~/jarvi/rxtx//download/prerelease/2.1)
> I installed RXTXcomm.jar, rxtxParallel.dll, rxtxSerial.dll)
> I tried to run it, and when it complained about missing Zsystem libraries, 
> I snagged the Zsystem-0.0-1.tar.gz and dropped Zsystem.jar into 
> jre\lib\ext.  I rebuilt all my stuff, and tried to run again.
> At run time, it confirmed the version:
> Native lib Version = RXTX-2.1-7pre12
> Java lib Version = RXTX-2.1-7pre12
> 
> At the point where I wrote to the serial port, and listened for a response 
> from the device, I got:
> Error reading from the serial port: No error in readArray
> java.io.IOException: No error in readArray
> at gnu.io.RXTXPort.readArray(Native Method)
> at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1296)
> at gnu.io.BufferedInputStream.fill(BufferedInputStream.java:183)
> at java.io.BufferedInputStream.read1(BufferedInputStream.java:222)
> at java.io.BufferedInputStream.read(BufferedInputStream.java:277)
> at java.io.FilterInputStream.read(FilterInputStream.java:90)
> ... Rest is stack trace of my code
> 
> Does anyone have any thoughts?
> 

Hi Mary

Wow.  You made it very far in the w32 build but didnt get a working 
library.  I'm very impressed you made it this far.

thoughts...  In short, w32 builds are yucky :)

What I usually do to build w32 ( this will probably be your best bet ) is 
install mingw from the from the mingw site.  I also had bad binaries show 
up if I used the cygwin 'easy install' mingw binaries.  I also install the 
cygwin easy install for things like sed, grep, vim (or emacs)...

Sometimes I dont actually install but just samba share the build tools.  I 
think this causes problems with makefiles and escape "\" characters.

With the tools installed I make sure no gcc, ld, asm can be called from
cygwin and put mingw at the front of the PATH.

with the following you can check out the last rxtx built on w32:

CVSROOT=:pserver:anonymous@cvs.milestonesolutions.com:/usr/local/cvsroot
(use whatever to set the variable in the shell you are using)

using password mousy

	cvs login

then checkout rxtx-2.1-7pre16

	checkout -r commapi-0-0-1 rxtx-devel

using the mingw32 makefile, things should build.

cross compiling has worked in the past but since there are some test 
suites on w32 under NDA, I just build mingw32 on w32.  lcc has built in 
the past but the makefile and code may not be in sync with lcc.  There 
would probably be some changes required.


I have more thoughts on the other errors you see but lets just focus on 
this build for now if you dont mind.
_______________________________________________
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