Questions about creating Cocos2d Lua project under Windows cannot debug relative (file not exist)

Source: Internet
Author: User
Tags lua

Environment Construction:
Follow the online tips, install pyhton2.7, download the cocos2d-x-3.x engine, install the Vs2012,babelua plugin.

Create a project:
Using commands in the Cocos2d-x-3.6\tools\cocos2d-console\bin directory cocos-new hellolua-p hellolua-d x:\

To start compiling:
In addition to some of the deprecated interface and the number of symbols comparison warning no error, after my small broken machine more than 20 minutes of compilation, all through, successfully generated a variety of libraries and Windows simulator.

To create a LUA project using the Babelua plugin:
Configure the script path (X:\HelloLua), emulator path (EXE), working path (X:\HELLOLUA)
Set the LUA project as the startup Project.

Everything is ready to start debugging
From the beginning, want to see AppBase source, breakpoint hit in Myapp.lua first line local MYAPP = Class ("MyApp", Cc.load ("MVC"). AppBase)
F5 started, then the problem came, learning excavator which strong ... Ah, no, not in the breakpoint = =! Nani, where the hell is the problem!!!

The first time online check, all wood has the same situation ... All right, find it yourself.
Confirm the environment is not a problem, plug-in no problem, configuration no problem ...

Take someone else's can debug simulator replacement, you can debug!!! Determine the problem is in the simulator
Compare the source of the simulator (how can there be a problem here), and even take a text editor to compare the project configuration,
Except the name is not the same, looks ok ...

Then we looked at the output of VS, and found that the normal project output was like this.
...
Load Script (9): F:\cocos_proj\ @Untitled10. Lua relative (file not exist)
Load script: F:\cocos_proj\ @Untitled11. Lua relative (file not exist)
Warning 1009:enabling Luajit C call return Work-around

Relative:. \src/main.lua
Findfile:f:\cocos_proj\hellolua\src\main.lua
Load script (one): F:\cocos_proj\HelloLua\src\main.lua
...

And then my project output is like this.
...
Load Script (9): F:\cocos_proj\ @Untitled10. Lua relative (file not exist)
Load Script: F:\cocos_proj\HelloLua\src\main.lua
Warning 1009:enabling Luajit C call return Work-around

Relative:. \config.lua
FindFile:. \config.lua
Load script: F:\cocos_proj\config.lua relative (file not exist)
...

Nani, it looks like Main.lua loading the wrong place.
The next step is to debug the emulator Engineering appdelegate::applicationdidfinishlaunching () function
Discover problems

#if (Cocos2d_debug > 0) && (Cc_code_ide_debug_support > 0)
Note:please don ' t remove the If want to debug with Cocos Code IDE
Auto Runtimeengine = Runtimeengine::getinstance ();
Runtimeengine->addruntime (Runtimeluaimpl::create (), Kruntimeenginelua);
Runtimeengine->start ();
#else
if (Engine->executescriptfile ("Src/main.lua"))
{
return false;
}
#endif

CodeIDESupport.h file Cc_code_ide_debug_support This macro was made into 0!!!
View the original project and the project that can be debugged this file, Cc_code_ide_debug_support is 1, I cried ...
I do not know how to copy the time to change to 0 ... Why do I have to wait for a rookie

Modify the value of the macro definition to 1,ok!

As to why it would become 0 did not go to study if any of the great gods knew trouble to tell.

Questions about creating Cocos2d Lua project under Windows cannot debug relative (file not exist)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.