首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Luabind未定义符号/ Luabind::scope::scope

Luabind未定义符号/ Luabind::scope::scope
EN

Stack Overflow用户
提问于 2015-07-20 09:53:35
回答 1查看 139关注 0票数 1

我刚刚开始使用Luabind,并尝试运行在http://www.rasterbar.com/products/luabind/docs.html#calling-lua-functions中指定的Hello World测试。但是,这会在尝试编译时提供一个未定义的符号错误。

代码语言:javascript
复制
Undefined symbols for architecture x86_64:
  "luabind::scope::scope(std::__1::auto_ptr<luabind::detail::registration>)", referenced from:
      luabind::scope luabind::def<void (*)(), luabind::detail::null_type>(char const*, void (*)(), luabind::detail::null_type const&) in TestClass.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

其他函数,如luabind::open和luabind::call_function都可以正常工作。

我在osx上通过自制软件安装了luabind和Lua5.1。

EN

回答 1

Stack Overflow用户

发布于 2015-12-08 21:28:10

在我看来,您正在使用libc++编译您的程序,并试图链接到针对stdlibc++库编译的Luabind库。

线索是std::__1::auto_ptr。libc++使用这个__1内联名称空间来区分它的ABI和stdlibc++

因此,如果

代码语言:javascript
复制
luabind::scope::scope(std::__1::auto_ptr<luabind::detail::registration>)

找不到它很可能是因为libluabind没有它。转储它的导出符号,你可能会发现它有

代码语言:javascript
复制
luabind::scope::scope(std::auto_ptr<luabind::detail::registration>)

而不是。

如果我是对的,只需重新编译以libc++为目标的libluabind,您就会发现它可以与您的测试程序一起工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31507853

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档