JNI with Cygwin...library locations

M

Matthew Zimmer

Hey all,
I've been forced to dip my hand into writing some JNI code (*sigh*) and
downloaded cygwin so I'd have a c++ compiler to use to write the dll
files. However, I don't know where the appropriate libraries to add in
my cc statement. According to the tutorial on java.sun, if I had
visualC++ I'd use the following for a HelloWorld example:
cl -Ic:\java\include -Ic:\java\include\win32
-LD HelloWorldImp.c -Fehello.dll

Could somebody please interpret this line for me as to what I need using
cygwin's c++ compiler. I have cygwin installed at c:\cygwin. Thanks
for any help.

Matthew
 
T

Thomas Fritsch

Matthew said:
Hey all,
I've been forced to dip my hand into writing some JNI code (*sigh*)
and downloaded cygwin so I'd have a c++ compiler to use to write the
dll files. However, I don't know where the appropriate libraries to
add in my cc statement. According to the tutorial on java.sun, if I
had visualC++ I'd use the following for a HelloWorld example:
cl -Ic:\java\include -Ic:\java\include\win32
-LD HelloWorldImp.c -Fehello.dll

Could somebody please interpret this line for me as to what I need
using cygwin's c++ compiler. I have cygwin installed at c:\cygwin.
Thanks for any help.

Matthew
Read the compiler reference of CL.EXE by yourself:
http://msdn.microsoft.com/library/d...us/vccore98/HTML/_core_Compiler_Reference.asp

Thomas
 
M

Matthew Zimmer

Thomas said:

Well, that wasn't what I was asking. I know the compiler options I
need. What I was asking was where the libraries I needed to include
were when using cygwin on windows. CL is a visualC++ compiler, not a
gcc compiler like you get with cygwin. However, I did find the correct
command from another web page and for anybody who is interested it is
this (assuming you're writing to hello.dll and reading from Hello.cpp):

gcc -mno-cygwin -I/usr/include -I/usr/include/win32
-Wl,--add-stdcall-alias -shared -o hello.dll Hello.cpp

Matthew
 
T

Thomas Fritsch

Matthew said:
Well, that wasn't what I was asking. ...

Matthew

Hi Matthew

OK, I misunderstood your phrase "Could somebody please interpret this
line for me ..." so as if you wanted the CL-call being explained.
Please excuse the impolite answer I gave!

Regards
Thomas
 
M

Matthew Zimmer

Thomas said:
Hi Matthew

OK, I misunderstood your phrase "Could somebody please interpret this
line for me ..." so as if you wanted the CL-call being explained.
Please excuse the impolite answer I gave!

Regards
Thomas

No problem...thanks for trying to help with it anyway. :) Re-reading my
question I can see where it was easy to misinterpret.

Matthew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top