TestLua on Xcode error

TestLua on Xcode error
0.0 0


I have just download the cocos2d-2.1beta3-x-2.1.1 project. and run the TestLua Demo on Xcode. but I got an error below. please help me out, thx.

Cocos2d: [LUA ERROR] …–208517D6EB66/TestLua.app//luaScript//controller.lua:7: module ‘luaScript/mainMenu’ not found:
no field package.preload[‘luaScript/mainMenu’]
no file ‘./luaScript/mainMenu.lua’
no file ‘/usr/local/share/lua/5.1/luaScript/mainMenu.lua’
no file ‘/usr/local/share/lua/5.1/luaScript/mainMenu/init.lua’
no file ‘/usr/local/lib/lua/5.1/luaScript/mainMenu.lua’
no file ‘/usr/local/lib/lua/5.1/luaScript/mainMenu/init.lua’
no file ‘/Users/riddick/Library/Application Support/iPhone Simulator/5.1/Applications/98C1A364-2E6D-4C58-BD0F-208517D6EB66/TestLua.app//l/luaScript/mainMenu.lua’
no file ‘./luaScript/mainMenu.so’
no file ‘/usr/local/lib/lua/5.1/luaScript/mainMenu.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’

THX again.



package.path = ‘?.lua;./?.lua;’…package.path

I do not work on unix derivative so this may be wrong.

I am not to sure why you need it.

for ex: Coding package.cpath = package.cpath…“;/mydrive/cocos2d-x/samples/Lua/TestLua/Resources/luaScript/?.lua”

Using the full path would work but is not normally used; relative path are preferred.

Note the ? is exactly replaced by the name specified in the require and the ; separates the path.

Good luck.