Embedding Lua with Xcode
Embedding Lua with Xcode
我在让Lua 5.2.0在Xcode 4中工作时遇到了问题。我使用 liblua.a 中链接的make
构建了它,添加了标头路径,并将其包含在 Extern "C"
中。我没有链接器错误。但是,当我运行此代码时:
#include <iostream>
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
}
int main (int argc, char *argv[])
{
lua_State *ls = lua_newstate(0, 0);
lua_close(ls);
return 0;
}
我在第 11 行得到Thread 1: EXC_BAD_ACCESS (code 1, address=0x0)
。我假设这是在告诉我,我实际上是在试图对不存在的东西发出呼吁。任何帮助将不胜感激!
谢谢马克
您正在将 NULL 内存分配函数传递给 lua_newstate
。难怪它会崩溃。也许你想使用luaL_newstate
?
相关文章:
- ld:bind_at_load和-bitcode_bundle(Xcode设置ENABLE_bitcode=YES)不能
- Problems with std::cin.fail()
- 在没有Xcode的情况下在Mac捆绑包中嵌入框架
- 应用程序崩溃并显示"symbol _ZdlPvm, version Qt_5 not defined in file libQt5Core.so.5 with link time reference"
- 这对"With a stackless coroutine, only the top-level routine may be suspended."意味着什么
- Xcode 语义问题引用或以前定义的代码
- 使用 Xcode 将双精度存储在数组C++中
- Boost.TEST with CLion: "Test framework quit unexpectedly"
- 避免碎片化的ClientHellos with OpenSSL (DTLS)
- Issues with Win32 ReadProcessMemory API
- Qt with WinAPI MouseProc
- Xcode C++错误"linker command failed with exit code 1"
- xcode:添加链接器标志和"link binary with libraries"的区别
- Tesseract working with XCode
- Embedding Lua with Xcode
- SDL with OSX without xcode
- Programming in C++ with Xcode 4
- C/C++ irrlicht with Mac/xcode
- Xcode 4 (or 3) iOS, with c++
- OpenCV with Xcode 5.0