Compiling Issues

Joined
Jul 24, 2006
Messages
3
Reaction score
0
Hello,
I am an intermediate java programmer and for some reason I can not getthe JNI example to work. The reason for this is I can not get a simple helloWorld dll created because when it comes to c++ i have no experience or scholling in this darn language. http://java.sun.com/docs/books/jni/html/start.html#769 is the reference I am using but I cant get past 2,5 because I am unable to create a simple .dll

this is the code as it should be in C++...
#include <jni.h>
#include <stdio.h>
#include "HelloWorld.h"

JNIEXPORT void JNICALL
Java_HelloWorld_print(JNIEnv *env, jobject obj)
{
printf("Hello World!\n");
return;
}

I could get this to work somewhat, in the directory i was in, using the c++ commandline compiler in VS6 i went from looking from one include to the next(I had to copy and paste the missing header files from another location in to my working directory for the compiler to find what it was looking for but i am still getting errors)

Any Ideas???


Thank you
 
Joined
Jul 24, 2006
Messages
3
Reaction score
0
Thank you for your assistance and It now works but i fear the next step is a lot harder...
if you have some time I keep getting these errors when I am compiling c++

C:\Program Files\Microsoft Visual Studio\MyProjects\Prompt\Prompt.cpp(29) : error C2819: type 'JNIEnv_' does not have an overloaded member 'operator ->'
c:\program files\microsoft visual studio\myprojects\prompt\jni.h(750) : see declaration of 'JNIEnv_'
C:\Program Files\Microsoft Visual Studio\MyProjects\Prompt\Prompt.cpp(29) : error C2227: left of '->GetStringUTFChars' must point to class/struct/union
C:\Program Files\Microsoft Visual Studio\MyProjects\Prompt\Prompt.cpp(34) : error C2819: type 'JNIEnv_' does not have an overloaded member 'operator ->'
c:\program files\microsoft visual studio\myprojects\prompt\jni.h(750) : see declaration of 'JNIEnv_'
C:\Program Files\Microsoft Visual Studio\MyProjects\Prompt\Prompt.cpp(34) : error C2227: left of '->ReleaseStringUTFChars' must point to class/struct/union
C:\Program Files\Microsoft Visual Studio\MyProjects\Prompt\Prompt.cpp(38) : error C2819: type 'JNIEnv_' does not have an overloaded member 'operator ->'
c:\program files\microsoft visual studio\myprojects\prompt\jni.h(750) : see declaration of 'JNIEnv_'
C:\Program Files\Microsoft Visual Studio\MyProjects\Prompt\Prompt.cpp(38) : error C2227: left of '->NewStringUTF' must point to class/struct/union


Any ideas...
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top