Cocos2dx running on Windows Platform

Hello all,
I have a doubt regarding how can we run cocos2dx project that was already build in mac using xcode to windows visual studio.
I mean i am able to create new project in windows platform using cocos2dx,but how can i use the existing project which was developed in mac using xcode to windows visual studio.

Thanks.

Hello all,
To my previous question i was able to create a new project in visual studio using cocos2dx,but i am not able to create new classes file,
Is there any way we can create new cocos2d class files in virtual studio.
and as well if i click any existing class file e.g appdelegate.cpp i am getting “microsoft ® visual c++ package server has stopped working” any idea why iam getting this error.
I am using visual studiio 2013 ultimate and cocos2dx 3.15.1 frame work.
Thanks.

If you have previously used XCode to build and run your project you should just be able to open the VS project file in proj.win32 and import the class files into your view in VS.

@damort how can we import class file in visual studio. if i added like clicking solution explorer and clicking add existing item it doesnt work.
Can you suggest the steps required to import class files.

Thanks.

add existing item should work… try drag and drop

@ bilalmirza , I have tried to drag and drop as well but while compiling it will show error for all scene except appdelegate and helloworld.
and also i am getting “microsoft ® visual c++ package server has stopped working” error when ever i open any class file in visual studio

when i build it after adding class files i am getting error as
1>------ Build started: Project: cppDebug, Configuration: Debug Win32 ------
1> AppDelegate.cpp
1> HelloWorldScene.cpp
1> newScene.cpp
1> main.cpp
1>d:\sushant\cppdebug\classes\newscene.hpp(13): error C2653: ‘cocos2d’ : is not a class or namespace name (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.hpp(14): error C2504: ‘Scene’ : base class undefined (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.hpp(16): error C2653: ‘cocos2d’ : is not a class or namespace name (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.hpp(16): error C2143: syntax error : missing ‘;’ before ‘’ (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.hpp(16): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.hpp(16): warning C4183: ‘createScene’: missing return type; assumed to be a member function returning ‘int’ (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.hpp(21): error C2653: ‘cocos2d’ : is not a class or namespace name (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.hpp(21): error C2061: syntax error : identifier ‘Ref’ (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.hpp(24): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.hpp(24): warning C4183: ‘CREATE_FUNC’: missing return type; assumed to be a member function returning ‘int’ (…\Classes\newScene.cpp)
1>d:\sushant\cppdebug\classes\newscene.cpp(10): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\sushant\cppdebug\classes\newscene.cpp(12): error C2143: syntax error : missing ‘;’ before '

1>d:\sushant\cppdebug\classes\newscene.cpp(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\sushant\cppdebug\classes\newscene.cpp(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\sushant\cppdebug\classes\newscene.cpp(14): error C2039: ‘create’ : is not a member of ‘newScene’
1> d:\sushant\cppdebug\classes\newscene.hpp(13) : see declaration of ‘newScene’
1>d:\sushant\cppdebug\classes\newscene.cpp(14): error C3861: ‘create’: identifier not found
1>d:\sushant\cppdebug\classes\newscene.cpp(22): error C2825: ‘Scene’: must be a class or namespace when followed by ‘::’
1>d:\sushant\cppdebug\classes\newscene.cpp(22): error C2039: ‘init’ : is not a member of ‘global namespace'' 1>d:\sushant\cppdebug\classes\newscene.cpp(22): error C2146: syntax error : missing ')' before identifier 'init' 1>d:\sushant\cppdebug\classes\newscene.cpp(22): error C2059: syntax error : ')' 1>d:\sushant\cppdebug\classes\newscene.cpp(24): error C2143: syntax error : missing '}' before 'return' 1>d:\sushant\cppdebug\classes\newscene.cpp(24): error C2064: term does not evaluate to a function taking 1 arguments 1>d:\sushant\cppdebug\classes\newscene.cpp(24): error C2143: syntax error : missing ';' before 'return' 1>d:\sushant\cppdebug\classes\newscene.cpp(27): error C2653: 'Director' : is not a class or namespace name 1>d:\sushant\cppdebug\classes\newscene.cpp(27): error C2227: left of '->getVisibleSize' must point to class/struct/union/generic type 1> type is 'unknown-type' 1>d:\sushant\cppdebug\classes\newscene.cpp(27): error C3861: 'getInstance': identifier not found 1>d:\sushant\cppdebug\classes\newscene.cpp(28): error C2146: syntax error : missing ';' before identifier 'origin' 1>d:\sushant\cppdebug\classes\newscene.cpp(28): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:\sushant\cppdebug\classes\newscene.cpp(28): error C2653: 'Director' : is not a class or namespace name 1>d:\sushant\cppdebug\classes\newscene.cpp(28): error C2227: left of '->getVisibleOrigin' must point to class/struct/union/generic type 1> type is 'unknown-type' 1>d:\sushant\cppdebug\classes\newscene.cpp(28): error C3861: 'getInstance': identifier not found 1>d:\sushant\cppdebug\classes\newscene.cpp(35): error C2653: 'MenuItemImage' : is not a class or namespace name 1>d:\sushant\cppdebug\classes\newscene.cpp(38): error C3867: 'newScene::menuCloseCallback': function call missing argument list; use '&newScene::menuCloseCallback' to create a pointer to member 1>d:\sushant\cppdebug\classes\newscene.cpp(38): error C2355: 'this' : can only be referenced inside non-static member functions or non-static data member initializers 1>d:\sushant\cppdebug\classes\newscene.cpp(35): error C3861: 'create': identifier not found 1>d:\sushant\cppdebug\classes\newscene.cpp(38): error C3861: 'CC_CALLBACK_1': identifier not found 1>d:\sushant\cppdebug\classes\newscene.cpp(40): error C2143: syntax error : missing ';' before '->' 1>d:\sushant\cppdebug\classes\newscene.cpp(40): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:\sushant\cppdebug\classes\newscene.cpp(40): error C2371: 'closeItem' : redefinition; different basic types 1> d:\sushant\cppdebug\classes\newscene.cpp(35) : see declaration of 'closeItem' 1>d:\sushant\cppdebug\classes\newscene.cpp(44): error C2653: 'Menu' : is not a class or namespace name 1>d:\sushant\cppdebug\classes\newscene.cpp(44): error C3861: 'create': identifier not found 1>d:\sushant\cppdebug\classes\newscene.cpp(45): error C2143: syntax error : missing ';' before '->' 1>d:\sushant\cppdebug\classes\newscene.cpp(45): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>d:\sushant\cppdebug\classes\newscene.cpp(45): error C2371: 'menu' : redefinition; different basic types 1> d:\sushant\cppdebug\classes\newscene.cpp(44) : see declaration of 'menu' 1>d:\sushant\cppdebug\classes\newscene.cpp(45): error C2825: 'Vec2': must be a class or namespace when followed by '::' 1>d:\sushant\cppdebug\classes\newscene.cpp(45): error C2039: 'ZERO' : is not a member of 'global namespace’’
1>d:\sushant\cppdebug\classes\newscene.cpp(46): error C2059: syntax error : ‘this’
1>d:\sushant\cppdebug\classes\newscene.cpp(54): error C2653: ‘Label’ : is not a class or namespace name
1>d:\sushant\cppdebug\classes\newscene.cpp(54): error C3861: ‘createWithTTF’: identifier not found
1>d:\sushant\cppdebug\classes\newscene.cpp(57): error C2143: syntax error : missing ‘;’ before ‘->’
1>d:\sushant\cppdebug\classes\newscene.cpp(57): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\sushant\cppdebug\classes\newscene.cpp(57): error C2371: ‘label’ : redefinition; different basic types
1> d:\sushant\cppdebug\classes\newscene.cpp(54) : see declaration of ‘label’
1>d:\sushant\cppdebug\classes\newscene.cpp(61): error C2059: syntax error : ‘this’
1>d:\sushant\cppdebug\classes\newscene.cpp(64): error C2653: ‘Sprite’ : is not a class or namespace name
1>d:\sushant\cppdebug\classes\newscene.cpp(64): error C3861: ‘create’: identifier not found
1>d:\sushant\cppdebug\classes\newscene.cpp(67): error C2143: syntax error : missing ‘;’ before ‘->’
1>d:\sushant\cppdebug\classes\newscene.cpp(67): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\sushant\cppdebug\classes\newscene.cpp(67): error C2371: ‘sprite’ : redefinition; different basic types
1> d:\sushant\cppdebug\classes\newscene.cpp(64) : see declaration of ‘sprite’
1>d:\sushant\cppdebug\classes\newscene.cpp(70): error C2059: syntax error : ‘this’
1>d:\sushant\cppdebug\classes\newscene.cpp(72): error C2059: syntax error : ‘return’
1>d:\sushant\cppdebug\classes\newscene.cpp(73): error C2059: syntax error : ‘}’
1>d:\sushant\cppdebug\classes\newscene.cpp(73): error C2143: syntax error : missing ‘;’ before ‘}’
1>d:\sushant\cppdebug\classes\newscene.cpp(77): error C2143: syntax error : missing ‘;’ before ‘{’
1>d:\sushant\cppdebug\classes\newscene.cpp(77): error C2447: ‘{’ : missing function header (old-style formal list?)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

First make sure you can compile and run a new cpp project in VS. If this fails I would suggest reinstalling VS. If it succeeds then drag n drop your game files into the VS project explorer, make sure your code is correct and then attempt a compile and run. If this fails then it’s your game code, because the previous step succeeded. Also try creating a new project, and using ‘cocos compile -p android’ to compile your project for Android, if you plan on targeting Android in the future.

hello damort, as you said i have created a new project and it is running properly and as well i am able to run cocos2dx test project as well but when i try the xcode created project it just displays only two class files helloword and appdelegate,

can you specifiy the steps needed to run the project in visual studio which was created by code, which means do we need to use command line before opening the project…

Thanks guys , I got the problem, In my new classes i didn’t include cocos2d.h file so it was giving error once i added that library it worked like a charm, but when i release the build for windows the executable file can be opened in windows 7, but when i try to run in windows 19 it gives error. I am using visual studio 2013.

Thanks.