把  (*env)->  都换成  env->  试试

解决方案 »

  1.   

    不行,改完后报这个错。------ Build started: Project: hello, Configuration: Debug Win32 ------
    Compiling...
    HelloWorld.cpp
    e:\program files\visual studio 2005\projects\goodluck\helloworld.cpp(21) : error C2660: 'JNIEnv_::GetStringUTFChars' : function does not take 3 arguments
    e:\program files\visual studio 2005\projects\goodluck\helloworld.cpp(26) : error C2819: type 'JNIEnv_' does not have an overloaded member 'operator ->'
            e:\program files\microsoft visual studio 8\vc\include\jni.h(750) : see declaration of 'JNIEnv_'
            did you intend to use '.' instead?
    e:\program files\visual studio 2005\projects\goodluck\helloworld.cpp(26) : error C2232: '->JNIEnv_::ReleaseStringUTFChars' : left operand has 'struct' type, use '.'
    e:\program files\visual studio 2005\projects\goodluck\helloworld.cpp(30) : error C2660: 'JNIEnv_::NewStringUTF' : function does not take 2 arguments
    Build log was saved at "file://e:\Program Files\Visual Studio 2005\Projects\goodluck\goodluck\Debug\BuildLog.htm"
    hello - 4 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
      

  2.   

    我把原文件由c++改成c的就好了。
    c和c++的方法调用不一样。不过我是初学者还不是很明白。