Some compile error on VS2010,how get it?

InitializeBuildStatus:
1> 正在对“Debug.win32\sfaafsdfasf.win32.unsuccessfulbuild”执行 Touch 任务。
1>ClCompile:
1> main.cpp
1>d:*2d\safa\sfaafsdfasf\win32\main.h: fatal error C1083: 无法打开包括文件:“CCStdC.h”: No such file or directory
1> HelloWorldScene.cpp
1>d:*2d\safa\sfaafsdfasf\classes\helloworldscene.h(4): fatal error C1083: 无法打开包括文件:“cocos2d.h”: No such file or directory
1> AppDelegate.cpp
1>d:+2d\safa\sfaafsdfasf\classes\appdelegate.h(4): fatal error C1083: 无法打开包括文件:“CCApplication.h”: No such file or directory
1> 正在生成代码…
1>
1>生成失败。
1>
1>已用时间 00:00:01.13
生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个

It looks like you’re in the wrong path, one more folder level is inserted between cocos2d & win32.
Please check the folder relationship is

cocos2d-x/MyGame/win32/Mygame.win32.vcproj
cocos2d-x/MyGame/classes/

能说详细点吗,看了网上现存的cocos2d-x在WIN上的安装教程,怎么我照着做就差那么多嗫。。。。。

The relation between the new created .vcproj file with cocos2d-x root, must be: cocos2d-x/MyGame/win32/Mygame.win32.vcproj,
consider your situation, it must be cocos2d/safa/win32/main.h, you have one more layer “sfaafsdfasf”, which cause the header search path invalid.

I was having the same problem. To fix it, I created my project in the root directory of cocos2d within the cocos2d solution.

But how would I create my own solution outside of the root directory?

I am using VC++ 2010 and I’ve setup my project directory to:
F:2d-1.0.0-x-0.9.0\cocos2dx\include

Then it complained about other files, so I added this directory:
F:2d-1.0.0-x-0.9.0\cocos2dx\platform

Then it complained about not finding files in that directory:
Cannot find file …

@sparkart
In theory, “…/platform/XXX” must can file the path from F:2d-1.0.0-x-0.9.0\cocos2dx\includeCan you paste the complete error output here? Which file & which line raise this error?

Error 1 error C1083: Cannot open include file: ‘CCStdC.h’: No such file or directory desktop\cocos2dtest\cocos2dtest\win32\main.h 11
Error 2 error C1083: Cannot open include file: ‘CCPlatformConfig.h’: No such file or directory f:2d-1.0.0-x-0.9.0\cocos2dx\include\ccconfig.h 30
Error 3 error C1083: Cannot open include file: ‘platform/CCApplication_platform.h’: No such file or directory f:2d-1.0.0-x-0.9.0\cocos2dx\include\ccapplication.h 28

This is in my include directories:
F:2d-1.0.0-x-0.9.0\cocos2dx\include

CCStdC.h & CCPlatformConfig.h are in cocos2dx/platform folder. Please make sure

F:2d-1.0.0-x-0.9.0\cocos2dx\platform

is added into the header include path.

That’s what I did before but then it complains about other files:

Error 1 error C1083: Cannot open include file: ‘platform/CCApplication_platform.h’: No such file or directory f:2d-1.0.0-x-0.9.0\cocos2dx\include\ccapplication.h 28
Error 2 error C1083: Cannot open include file: ‘platform/CCGL.h’: No such file or directory f:2d-1.0.0-x-0.9.0\cocos2dx\include\ccgl.h 25
Error 3 error C1083: Cannot open include file: ‘platform/CCApplication_platform.h’: No such file or directory f:2d-1.0.0-x-0.9.0\cocos2dx\include\ccapplication.h 28

Here is what my include directories look like now:
F:2d-1.0.0-x-0.9.0\cocos2dx\include
F:2d-1.0.0-x-0.9.0\cocos2dx\platform

OK, add the last one
F:2d-1.0.0-x-0.9.0\cocos2dxinto include dir

Error 1 error C1083: Cannot open include file: ‘GLES/gl.h’: No such file or directory f:2d-1.0.0-x-0.9.0\cocos2dx\platform\ccgl.h 68
Error 2 error C1083: Cannot open include file: ‘GLES/gl.h’: No such file or directory f:2d-1.0.0-x-0.9.0\cocos2dx\platform\ccgl.h 68

F:2d-1.0.0-x-0.9.0\cocos2dxF:2d-1.0.0-x-0.9.0\cocos2dx\include
F:2d-1.0.0-x-0.9.0\cocos2dx\platform

omg…
F:2d-1.0.0-x-0.9.0\cocos2dx\platform\third_party\win32\OGLES
I don’t have the win32 environment currently. Please open Tests.vcproj, and copy all the path settings to your solution, with F:2d-1.0.0-x-0.9.0prefix

It had to be converted, and the include directories are empty. I also don’t think it was setup because test is in the same solution as the cocos2dx project.

I give up,and I use mac……………beijua

nvm, I have it figured out. There are a bunch of third-party libraries that cocos2d-x depends on.

sparkart . wrote:

nvm, I have it figured out. There are a bunch of third-party libraries that cocos2d-x depends on.

Would you please share the steps? We’ve got the same issue that the project does not work. Thanks for your help.

There are a lot of third-party libraries that I decided to simply make my project in the same solution. All the problem is that you need to setup your directories, which I knew, but after setting up the directory, I have to setup another and another and another. I didn’t think this was right, so I asked the forums and Walzer is basically telling me that the error means exactly what it means. Just setup your directories until it stops complaining.

My last problem is complaining about ‘GLES/gl.h’ All you have to do is setup the directory to the location of ‘gl.h’. In my case, that would be:
’F:2d-1.0.0-x-0.9.0\cocos2dx\platform\third_party\win32\OGLES

It will probably complain about all the other third-party libraries. Just setup the directories. Or you can just do what I did and do exactly what they said on the tutorial. Create your project within the cocos2d-x solution. Sure you might not like that. If you don’t like that, just setup all the directories until it stops complaining about files not being found. I decided to just create my project within the cocos2d-x solution as stated in the tutorial.

I surrender to the sucking Visual Studio long time ago :slight_smile: That’s why we write the tutorial like this. Creating vcproj in cocos2d-x solution is nothing about elegant, but it reduce lots of unnecessary works.

是在是抱歉,英语水平不好,现在我按照你说的改了,我是在VS2010下配置的,官方步骤进行到
4、Add a New Application Project¶

这一步,出错了,现在是LINK错误,1>LINK : fatal error LNK1104: 无法打开文件“libcocos2d.lib”

由于对VS2010不太熟悉 ,我先去网上搜搜LINK错误的原因,但是也请您能给个解决方法,谢谢了

呵呵 我做到了 呵呵 呵呵呵 明白怎么回事了 Thanks ,cocos2d-x真的很强大,以后会随着移动互联网的大旗,走向盛世 谢谢了 王哲老师,以后若能有机会参加移动开发大会,一定一睹您的风采,上次没赶上。。。。。