Include files missing

these are the steps i took to install cocos 2d-x:

download http://cocos2d-x.googlecode.com/files/cocos2d-1.0.1-x-0.9.1.zip
extract it to C:run build-win32.bat
run install-templates-msvc.bat
run C:2d-cocos2d-x-0afb47e\HelloWorld\win32\HelloWorld.win32.vcproj

here’s what i get when i try to compile it :

1>—— Build started: Project: HelloWorld, Configuration: Debug Win32 ——
1> main.cpp
1>c:2d-cocos2d-x-0afb47e\helloworld\win32\main.h(11): fatal error C1083: Cannot open include file: ‘CCStdC.h’: No such file or directory
1> HelloWorldScene.cpp
1>c:2d-cocos2d-x-0afb47e\helloworld\classes\helloworldscene.h(4): fatal error C1083: Cannot open include file: ‘cocos2d.h’: No such file or directory
1> AppDelegate.cpp
1>c:2d-cocos2d-x-0afb47e\helloworld\classes\appdelegate.h(4): fatal error C1083: Cannot open include file: ‘CCApplication.h’: No such file or directory
1> Generating Code…
Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped

i’ve reread the tutorial numerous times and i can’t find what i’m doing wrong. i also tried visual c++ express 2008 and vs2010 on windows xp and even tried compiling manually with cocos2d-win32.vc2010.sln and it still won’t work. the same happens when creating new projects. any help?

hello, when you extract the source codes to c: you could run cocos2d-win32.vc2008.sln directely, then set helloworld as setup project, build and run it.

if still not succeed, check that if the directory which the unfound files lie in has been added to “Additional Include Directories” and if the unfound files exist.

I have got the same issue. Could you tell me step by step what I have to do ? As I am very new with Cocos2dx and Visual Studio, I don’t know how to follow the solutions proposed by RongHong Huang. Thanks for your help.

As if the broken tutorial for VS 2010 wasn’t bad enough…now we get this error.

I can only assume that Cocos2D-X for Windows DOES NOT WORK and is incomplete.

The feature should be removed from the website, as it simply doesn’t work.

Why waste other’s time like this?

1 Like

I honestly cant remember what i did to make it work, since its working for me now i can only suggest some things you can do: use visual studio or express 2008, compile with build_win32.bat. You might have some other issues when making new projects or compiling for android but they can all be solved. Im happily developing on windows 7 and compiling to my android device so if you have any questions or problems just post them here.

I’m still getting the three errors in the OP.

I stick with 2008 since 2010 wont even run or work at all with this. However, it still won’t build without errors.

When I run build-win32.bat, it works and everything but I do notice some errors, is this normal?

I have tried several times to do EXACTLY as the directions require, but no matter what I do it’s always the same.

build_win32.bat should show some warnings but not errors, if you had any errors then you probably wouldn’t have seen the tests app after build_win32 finishes compiling.
you should also run from the 2008.sln project file and select helloworld or tests as the startup project ( right click on project name in solution explorer and select ‘set as startup project’ ) then just normally compile and run.

I found a solution, and I think I understand why. The fact it merges all the directories without giving you options really messed me up!

  1. X:2Dx (where my source is, unzipped the entire source file into this folder)
  2. Ran build_win32.bat

^ This is where it created the solution, Debug.win32 & Release.win32.

  1. Took the resources from Release.win32 and copy/pasted them into Debug.win32 (the png files, music files, etc. All the art and sound resources.)

  2. Now both test.exe and helloworld.exe work in both Debug.win32, Release.win32. Debug.win32’s exe files wouldnt work bc the resources werent there (png’s images, etc.)

  3. After running build_win32.bat, it created these directories
    X:2Dx\Debug.win32
    X:2Dx\Release.win32

  4. I created a new project, which created this folder. (This only worked in VS 2008, as it gives a Script Error in the Wizard in VS 2010).
    X:2Dx\RonnyCC2DxProject

  5. I copy and pasted Debug and Release folders into my project folder.
    X:2Dx\RonnyCC2DxProject\Debug.win32
    X:2Dx\RonnyCC2DxProject\Release.win32

  6. I can now successfully build Debug version of the project without any errors.

  7. Building a Release version of the project still gave errors.

  8. It gave errors such as “cannot access *.lib file" or "missing.dll” so I copy/pasted all the .lib files into the correct folder. I forgot which, but one of them don’t have the .lib files. I did the same for the missing .dll files. I believe I did this copy/paste into the Release.win32 folder but I really forgot. Should be self explanatory though and an easy fix to just place the files in the correct folder (or just all folders).

  9. Both now work, although Release builds give a debugging information error but pressing “Yes, continue anyway” runs the program perfectly.

Solved!

My bad, build-win32.bat had like 1200 warnings, but 0 errors. You’re right.

i don’t know if this is related, but right now i’m using the files downloaded from here and not from github,
also you’ll want to create a new android project ( if that’s what you’re developing for, haven’t tried iphone myself ) since it’s kinda tricky to get the files and makefiles right so it would be even more annoying when you have a big project with lots of files to convert to android.(once you setup the android project you can work on windows and compile directly to the android ndk by only adding new .cpp files to one makefile)

there’s some guides around for creating android projects, i used the one here in the wiki, the only problem i had was that i had space’s in my file directories i.e. c:Files\cygwin wouldn’t work since there’s a space character between Program and Files.

wow, thank you very much!

I’m sure this will save me a ton of headaches when it comes time to build to Android/iphone :slight_smile:

Very grateful!

Hey, I am getting this error please help me in solving this.i googled a lot but found nothing related to this error.

Here is the Error:-

jni/hellocpp/main.cpp:1:25: fatal error: AppDelegate.h: No such file or directory

Here is my Android.mk file :-

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_shared

LOCAL_MODULE_FILENAME := libgame

LOCAL_SRC_FILES := hellocpp/main.cpp
…/…/Classes/AppDelegate.cpp
…/…/Classes/HelloWorldScene.cpp

LOCAL_C_INCLUDES :=/$(LOCAL_PATH)/…/…/Classes $(LOCAL_PATH)/include

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,CocosDenshion/android)
$(call import-module,cocos2dx)
$(call import-module,extensions)

Check the Classes directory, can you see the AppDelegate.h file there?

Hey, Thanks for your reply , yes i checked there and found the AppDelegate.h in classes directory and then i copied the whole content to my hellocpp folder and the error disappears but Now i am getting new error whose link is as Follows :-


Inspite of installing libpng12-dev and libjpeg i am getting this error.Can you please tell me that where i am lacking in process.
Thanks.