ccf123(ccf) 你说的没有错 可是现在又有一个新的错误了 我想大概是project的setting里的那个precompiled header吧府上错误信息: Debug/hello.pch' is not a precompiled header file created with this compiler
哦!总是有错误出来 当我把"stdafx.h"加入之后,又有下面的错误了: Cannot open include file: 'StdAfx.h': No such file or directory
#include "jni.h"
#include "HelloWorld.h"
#include "stdio.h"
JNIEXPORT void JNICALL
java_HelloWorld_displayHelloWorld(JNIEnv *env,jobject obj)
{
printf("Hello World!\n");
return;
}
没有找到 precompiled header
在出错的源文件的最前面。
wuchuncai(无蠢材)说的没错。
在源文件中
#include "yourshead.h"一句要放在 "StdAfx.h"的后面
可是现在又有一个新的错误了
我想大概是project的setting里的那个precompiled header吧府上错误信息:
Debug/hello.pch' is not a precompiled header file created with this compiler
当我把"stdafx.h"加入之后,又有下面的错误了:
Cannot open include file: 'StdAfx.h': No such file or directory
如果要使用则必须project->Setting...(ALT+F7)->C/C++->Precompiled headers-——>use ...
一一对应的
改完后都要rebuild的
改为use,还是会出现原来的问题:Debug/hello.pch' is not a precompiled header file created with this compiler
你的工程中必须有一个(最多也只能一个)cpp要create一个pch文件
在那几个选项中选择create pch一项
试试吧
:)