这个是日志:
--------------------------------- Setting Info -----------------------------------------
Setting name: test_lua3.4_script
Lua scripts folder: E:\test_lua3.4\src
Lua exe path: E:\test_lua3.4\runtime\win32\test_lua3.4.exe
Working path: E:\test_lua3.4\runtime\win32
Command line:
----------------------------------------------------------------------------------------
E:\test_lua3.4\runtime\win32\test_lua3.4.exe
Debugger attached to process
0x037501c0: VM created
package.path: .\?.lua;E:\test_lua3.4\runtime\win32\lua\?.lua;E:\test_lua3.4\runtime\win32\lua\?\init.lua;
Load script(0): E:\test_lua3.4\src\@Untitled1.lua relative (file not exist)
Load script(1): E:\test_lua3.4\src\@Untitled2.lua relative (file not exist)
Load script(2): E:\test_lua3.4\src\@Untitled3.lua relative (file not exist)
Load script(3): E:\test_lua3.4\src\@Untitled4.lua relative (file not exist)
Load script(4): E:\test_lua3.4\src\@Untitled5.lua relative (file not exist)
Load script(5): E:\test_lua3.4\src\@Untitled6.lua relative (file not exist)
Load script(6): E:\test_lua3.4\src\@Untitled7.lua relative (file not exist)
Load script(7): E:\test_lua3.4\src\@Untitled8.lua relative (file not exist)
Load script(8): E:\test_lua3.4\src\@Untitled9.lua relative (file not exist)
Load script(9): E:\test_lua3.4\src\@Untitled10.lua relative (file not exist)
我折腾了2天,还是没有 成功,希望能帮助下,刚开始用 vs.
最开始用VS新建3.4 lua项目时,直接黑屏,不能直接运行,每次都要刷新才行.后来在AppDelegate.cpp的bool AppDelegate::applicationDidFinishLaunching()下开始的位置添加:
//add search paths/////////////////////////////
string strPath = CCFileUtils::getInstance()->getWritablePath();
vector<string> vtPath = CCFileUtils::getInstance()->getSearchPaths();
vtPath.push_back(strPath + "res/");
vtPath.push_back(strPath + "src/");
CCFileUtils::getInstance()->setSearchPaths(vtPath);
在src目录下的main.lua文件中加入
package.path = package.path..";src/?.lua"
这个是配置