Good morning!
I too am having problems compiling with gcc under cygwin. But above
that, I'm concerned about my concept as a whole...
What I want to do is create an enumerator similar to the one at
http://www.two-dimes.net. That would be simple enough I think, but
I'd like to load it onto my cell phone. The Java Layer is money, so
easy. It's the hooks to the C code that make me lose hair:
System.loadLibrary("poker");
System.loadLibrary("pokerjni");
There are 3 pots on the stove right now. I'll summarize and then go
into detail...
1) Compiling the JNI under Cygwin
2) Will the Native C work on my cell phone
3) Will my Windows IDE be able to use the cygwin compiled code
1)
So I know that these are the JNI interface things that need to be
compiled from the source. The compiler takes care of the non-java
stuff just fine, it's the stuff under that java directory that
won't 'make' successfully:
right now, I'm using the following code in my Makefile.IN in
the /java:
$(CC) $(CFLAGS) -mno-cygwin -I. -I../include $(JNI_INCLUDES) -Wl,--
add-stdcall-alias -shared -c $< -o $@
the '-mno-cygwin' is for not using the cygwin dependancies. after I
added that, the 'make' went a little further. The '-Wl,--add-stdcall-
alias -shared' was added from some info I found at
'http://www.inonit.com/cygwin/jni/helloWorld/c.html'
the most current error I'm getting is:
gcc -mno-cygwin -shared -Wl,--add-stdcall-alias -L../lib -lpoker -
o ../lib/libpokerjni.so org/pokersource/eval/StandardEvalImp.o
org/pokersource/eval/JokerEvalImp.o
org/pokersource/eval/AsianStudEvalImp.o
org/pokersource/enum/EnumerateImp.o jniutil.o pokutil.o
org/pokersource/eval/StandardEvalImp.o
(.text+0x225):StandardEvalImp.c: undefined reference to `_nBitsTable'
org/pokersource/eval/StandardEvalImp.o
(.text+0x248):StandardEvalImp.c: undefined reference to `_nBitsTable'
..........
org/pokersource/enum/EnumerateImp.o(.text+0x535):EnumerateImp.c:
undefined reference to `_enumExhaustive'
org/pokersource/enum/EnumerateImp.o(.text+0x58a):EnumerateImp.c:
undefined reference to `_enumSample'
pokutil.o(.text+0x4c):pokutil.c: undefined reference to
`_StdDeck_cardMasksTable'
pokutil.o(.text+0x53):pokutil.c: undefined reference to
`_StdDeck_cardMasksTable'
pokutil.o(.text+0xe9):pokutil.c: undefined reference to
`_StdDeck_cardMasksTable'
maybe my LD_LIBRARY_PATH is bad?
That's where I'm at in terms of compiling the Java Native stuff. I
think I can probably get this one to work...
2)
My largest concern at this point is that my Series 40 Nokia 6200
won't support the JNI. I think I have to include the native code
files (.dll, .so, .whatever) into my final JAR, but will the phone OS
support it? I'm going to research that right now.
3)
My other concern is, I'm on a Windows Box, and even if I get
the 'make' to go properly in cygwin, will my IDE (SunOne Studio) be
able to recognize and incorporate cygwin compiled code in my java
app? I have a feeling it'll be looking for a .dll :( And The README
indicated that the Java layer was not ready to be compiled into
msdos, so I think it's cygwin or bust. That wouldn't be the end of
the world, I'd just have to get an IDE for cygwin or do it all from
the terminal (Oh, Joy!)...
I'd really love to do this, it's not for school or work, it would
just be great to have an enumerator on my cell phone. Any help is
appreciated, and whatever the results are will be open for all to see
and use...
Thanks!
Fred