It is okay to create a cocos2dx project from 0 and run it. But what if we want to create our own scenario class? The theory is always stuck in the theory, and it is not that simple to know the problem after practice: Initial Attempt: 1. in the classes folder of the Project, right-click-add-new item -- and start to write the class code. 2. in the logical class
It is okay to create a cocos2dx project from 0 and run it. But what if we want to create our own scenario class? The theory is always stuck in the theory, and it is not that simple to know the problem after practice: Initial Attempt: 1. in the classes folder of the Project, right-click-add-new item -- and start to write the class code. 2. in the logical class
It is okay to create a cocos2dx project from 0 and run it. But what if we want to create our own scenario class?
The theory is always stuck in the theory, and it is not that simple to know the problem after practice:
Preliminary attempt:
1. In the classes folder of the Project, right-click-add-new item-and start to write the class code;
2. A problem occurs when a logical class is referenced, that is, # include "LoadingLayer. h". Will the system prompt "cannot be found?
3. After chatting with a network expert, you will know that the default class path is actually under the default sln path, but vs projects cannot simply include;
Solution:
A. If there is A problem with the class path, you can manually set the include path;
B. manually copy the source code files under the newly added default sln directory to the Classes of the corresponding project (include default Reference Directory );
Last,. Delete the newly added code file in vs project, and then add it again to restore the normal operation.
Enter the graphic mode:
1. Error prompt during import
2. view the path of the new file (in the default path of cocos-sln path-non-CLasses path)
3. manually copy the new source code file to the Classes path of the corresponding project
4. Delete the source file in the project, right-click Classes-add-existing item-find Classes path-add new file
5. Check the location where the new file is referenced. The path is valid and there is no error message.
Cocos2dx was officially launched,
Recurrence of compilation process problems:
1. win32 can be properly compiled and displayed, but cross-compilation fails:
Error: undefined reference to 'loadinglayer: scenc e ()'
This indicates that this class is not referenced during cross-compilation;
Go to the android. mk file in the Android project and check whether a line is added after LOCAL_SRC_FILES.
.../../Classes/LoadingLayer. cpp remember to add a backslash after the previous line ----> "\"
Go to cygwin again, find the corresponding Android directory, grant permissions, and then./build_native.sh;
Http://stackoverflow.com/questions/12125248/trying-to-switch-scenes-in-cocos2d-x-undefined-reference-to-diffmenuscene
2. When everything is ready and. so has been generated, the following error message will appear during compilation in the eclipse console:
Unable to add 'd: \ series_cocos2d-x \ cocos2d-x-2.2.1 \ cocos2d-x-2.2.1 \ projects \ LoveHong \ proj. android \ assets \ CloseNormal.png ': Zip add failed
ERROR: unable to process assets while packaging 'd: \ series_cocos2d-x \ cocos2d-x-2.2.1 \ cocos2d-x-2.2.1 \ projects \ LoveHong \ proj. android \ bin \ resources. ap _'
[13:04:12-LoveHong] ERROR: packaging of 'd: \ series_cocos2d-x \ cocos2d-x-2.2.1 \ cocos2d-x-2.2.1 \ projects \ LoveHong \ proj. android \ bin \ resources. ap _ 'failed
If the above error occurs, the solution is as follows:
In the cygwin window, cd assets; chmod-R 777 * [Alternate moves cd.../build_native.sh]
Refresh the project to be compiled in eclipse. [if any problem occurs, try the above steps several times]
3. There is no problem running on the real machine. The following error message is displayed in the simulator:
......: No configs match configSpec
...
Emulator without GPU emulation detected.
Indicates that the GPU support is not enabled for the started simulator. ---- open the simulator management interface. Select the simulator you want to start. -- edit -- choose Use Host GPU
If you are using genymotion as the simulator, you need to install a plug-in Genymotion-ARM-Translation; (self-retrieval)
Geny is an x86 architecture and non-ARM architecture, so it runs fast. You need to install a plug-in that can be converted into an ARM architecture to run it perfectly;