你在PROJECT的设置里把precompiled header去掉看看.
还有就是跟你的头文件的定义可能有关. 

解决方案 »

  1.   

    .c文件:
    #include "jni.h"
    #include "HelloWorld.h"
    #include "stdio.h"
    JNIEXPORT void JNICALL
     java_HelloWorld_displayHelloWorld(JNIEnv *env,jobject obj)
      {
        printf("Hello World!\n");
        return;
    }
      

  2.   

    "stdafx.h"本来就有的。
    没有找到 precompiled header
      

  3.   

    #include "stdafx.h"
    在出错的源文件的最前面。
    wuchuncai(无蠢材)说的没错。 
      

  4.   

    project->Setting...(ALT+F7)->C/C++->Precompiled headers->Not using...
      

  5.   

    在头文件和源文件中各加一个 #include "StdAfx.h"
    在源文件中
    #include "yourshead.h"一句要放在 "StdAfx.h"的后面
      

  6.   

    ccf123(ccf) 你说的没有错
    可是现在又有一个新的错误了
    我想大概是project的setting里的那个precompiled header吧府上错误信息:
    Debug/hello.pch' is not a precompiled header file created with this compiler
      

  7.   

    哦!总是有错误出来
    当我把"stdafx.h"加入之后,又有下面的错误了:
    Cannot open include file: 'StdAfx.h': No such file or directory
      

  8.   

    如果你不使用stdafx.h则必须project->Setting...(ALT+F7)->C/C++->Precompiled headers->Not using... 
    如果要使用则必须project->Setting...(ALT+F7)->C/C++->Precompiled headers-——>use ... 
    一一对应的
    改完后都要rebuild的
      

  9.   

    找不到 "StdAfx.h" 就那别的程序目录下去拷一个
      

  10.   

    可是,为什么我一旦在源文件中加入"stdafx.h",然后把Precompiled headers
    改为use,还是会出现原来的问题:Debug/hello.pch' is not a precompiled header file created with this compiler
      

  11.   

    加入这句以后,
    你的工程中必须有一个(最多也只能一个)cpp要create一个pch文件
    在那几个选项中选择create pch一项
    试试吧
    :)