dcsimg
Running into compile problems when tring to create the MyImpOfPrompt shared library
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Java_Boy
Posted On:   Thursday, September 20, 2001 10:53 AM

I am trying to run the Prompt example from Suns java tutorial for JNI. I am doing this on a Windows 2000 Professional OS and Microsoft's Visual C++ 6.0. When trying to create the shared library using the following command: cl -ID:devtoolsDevStudiojb5projbuilder5jdk1.3include -ID:devtoolsDevStudiojb5projbuilder5jdk1.3includewin32 -LD Prompt.cpp -FeMyImpOfPrompt.dll I get the following errors:Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved. Prompt.cpp Prompt.cpp(10) : error C2819: type 'JNIEnv_' does not have an overloaded member 'operator ->' D:devtoolsDevStudiojb5projbuilder5jdk1.3inclu   More>>

I am trying to run the Prompt example from Suns java tutorial for JNI. I am doing this on a Windows 2000 Professional OS and Microsoft's Visual C++ 6.0.
When trying to create the shared library using the following command:

cl -ID:devtoolsDevStudiojb5projbuilder5jdk1.3include -ID:devtoolsDevStudiojb5projbuilder5jdk1.3includewin32 -LD Prompt.cpp -FeMyImpOfPrompt.dll



I get the following errors:Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

Prompt.cpp
Prompt.cpp(10) : error C2819: type 'JNIEnv_' does not have an overloaded member
'operator ->'
D:devtoolsDevStudiojb5projbuilder5jdk1.3includejni.h(746) : see d
eclaration of 'JNIEnv_'
Prompt.cpp(10) : error C2227: left of '->GetStringUTFChars' must point to class/
struct/union
Prompt.cpp(12) : error C2819: type 'JNIEnv_' does not have an overloaded member
'operator ->'
D:devtoolsDevStudiojb5projbuilder5jdk1.3includejni.h(746) : see d
eclaration of 'JNIEnv_'
Prompt.cpp(12) : error C2227: left of '->ReleaseStringUTFChars' must point to cl
ass/struct/union
Prompt.cpp(14) : error C2819: type 'JNIEnv_' does not have an overloaded member
'operator ->'
D:devtoolsDevStudiojb5projbuilder5jdk1.3includejni.h(746) : see d
eclaration of 'JNIEnv_'
Prompt.cpp(14) : error C2227: left of '->NewStringUTF' must point to class/struc
t/union

The java source code and the native code implementation I am using are the same as listed online in the tutorial.

Please help!
Thanks
FPN

   <<Less

Re: Running into compile problems when tring to create the MyImpOfPrompt shared library

Posted By:   Muyeen_Munaver  
Posted On:   Wednesday, October 10, 2001 07:45 AM

The Prompt example that is there in the tutorials is for the C language. At the end of the tutorial there is a section which tells what is the modification that needs to be made for C++.

Whereever there is
(*env)-> change to (env)-> and also change the parameter for functions which take env as a parameter, remove the env as a parameter.



Regards,

Muyeen
About | Sitemap | Contact