Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup cocos2d-x application through visual studio 2010 project template

I'm trying to setup an application on Windows 7 using Cocos2D-x.

I followed this tutorial.

I did the following:

  1. Built the library running Build-win32.bat script. Works.
  2. Installed VS2010 project template. Works.
  3. Run successfully all test programs.
  4. Created a new cocos2D-x project through the installed template. Works

When I compile the Hello World application I have the follwing errors:

error C1083: impossible to open inclusion file 'CCstdC.h' No such file or directory
error C1083: impossible to open inclusion file 'cocos2d.h' No such file or directory

It's a wrong include path.

I could fix it by manually modifying include path but since I'm creating project through the template I-d like to solve this, possibly not having to modify paths manually for each new project I'll create.

Did anyone ever had the same issue?Do you know how to fix this?

like image 742
Heisenbug Avatar asked Jan 15 '23 17:01

Heisenbug


1 Answers

Well, I setup cocos2dx projects like this:

  1. create an empty win32 app in VS
  2. open the folder contains your .sln file (your solution folder)
  3. open the cocos2dx package (i.e. cocos2d-1.0.1-x-0.12.0.zip) with 7z or something
  4. drag cocos2dx, and optionally CocosDenshion, Box2D, etc. to your solution folder
  5. add cocos2dx project (cocos2dx\proj.win32\cocos2d-win32.vcxproj) into your solution
  6. go to your project's properties, select C/C++->General, add the following entries to your Additional Include Directories option:

    ..\cocos2dx; ..\cocos2dx\include; ..\cocos2dx\platform; ..\cocos2dx\platform\win32; ..\cocos2dx\platform\third_party\win32\OGLES

and ..\CocosDenshion\include if you're using the SimpleAudioEngine

  1. in the Linker->Input->Additional Dependencies option, add libcocos2d.lib, and libCocosDenshion.lib if you use the audio engine; in the Linker->General->Additional Library Directories option, add $(OutDir)

  2. go to the Configuration Properties->General->Output Directory option, set it to $(SolutionDir)\build\

  3. open the project property for cocos2d library, go to the Configuration Properties->General->Output Directory, set it to $(SolutionDir)\build\, also do that to the rest of the libraries you included.

All set, you're ready to go.

like image 177
Rango Avatar answered Feb 01 '23 23:02

Rango