JNI DLL VC++

A

Ann

I am working on the helloworld JNI program. I am using VC++ 6.0 to
generate a dll.
Are there any particular settings that I should take care of to
generate the dll.
I have included jni.h and helloworld.h in the vc++ project and have
also copied the .h files in the include directory of VC++.

However I am not able to build the .c file.
I am using JDK1.5

Please suggest a solution...

Thank You,
Ann
 
A

Ann

Ann said:
I am working on the helloworld JNI program. I am using VC++ 6.0 to
generate a dll.
Are there any particular settings that I should take care of to
generate the dll.
I have included jni.h and helloworld.h in the vc++ project and have
also copied the .h files in the include directory of VC++.

However I am not able to build the .c file.
I am using JDK1.5

Please suggest a solution...

Thank You,
Ann

Hi Ann,

I too have VC++ 6.0
If I remember correctly, the instructions suggest that
you use the 'cl' command which is from the command line
and does a compile and link. That's the way I do it and
it works fine (for java 1.4.2 anyway.)
 
S

sp

an you explain the error message?
That is, you can't compile with VC++?
Have you set the LIB and INCLUDE ?
in VC++:

Tools->Options..
then appear a tabbed windows.
Click on Directories tab.
"Show directory for": Include file
and then Add:
<path_of_your_jdk>\jdk\Include
and
<path_of_your_jdk>\jdk\Include\win32

Then switch the combo "Show directory for" to Library files
and Add:
<path_of_your_jdk>\jdk\Lib


Then recompile.
 
A

Ann

Ann said:
Thank You for your response. But where is the cl.exe ?? Is it part of
JDK??

It is part of VC++, for me it is in
C:\Program Files\Microsoft Visual Studio\VC98\Bin
 
A

Ann

I gave this command
cl -IC:\Program Files\Java\jdk1.5.0\include -IC:\Program
Files\Java\jdk1.5.0\include\win32 -LD HelloWorldImp.c -Fehello.dll

However I am getting this error
The Dll mspdp60.dll could not be found in the specified path

Any suggestions??
 
A

Ann

I gave this command

cl -IC:\Program Files\Java\jdk1.5.0\include -IC:\Program
Files\Java\jdk1.5.0\include\win32 -LD HelloWorldImp.c -Fehello.dll

However it throws an error li
DLL msdp60.dll not found in the specified path.

Any Suggestions?
Thanks..
 
A

andreas

cl -IC:\Program Files\Java\jdk1.5.0\include -IC:\Program
Files\Java\jdk1.5.0\include\win32 -LD HelloWorldImp.c -Fehello.dll

However it throws an error li
DLL msdp60.dll not found in the specified path.

Any Suggestions?
Thanks..

that happens when you run cl.exe from command line because it won't find
the msdp60.dll . but note that cl.exe is part of your VS 6.0.

it is called when compiling and linking in VS 6.0

just build your program as a dll library (from within your IDE). there are
no other requirements
to get it to work with jni. at least, thats what i did and it worked fine...

andreas
 

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,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top