首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >与pantheios的链接问题-未定义的参考pantheios_init

与pantheios的链接问题-未定义的参考pantheios_init
EN

Stack Overflow用户
提问于 2013-07-18 00:32:00
回答 1查看 394关注 0票数 1

我已经阅读了几乎所有与此相关的帖子。正如许多地方所建议的那样,我确实链接到了核心库两次。我就是搞不明白问题出在哪里。下面是错误:

代码语言:javascript
复制
main.o: In function `pantheios_initialiser::pantheios_initialiser()':
/home/awishformore/code/pantheios/include/pantheios/./internal/initialiser.hpp:119: undefined reference to `pantheios_init'
/home/awishformore/code/pantheios/include/pantheios/./internal/initialiser.hpp:121: undefined reference to `pantheios_exitProcess'
main.o: In function `pantheios_initialiser::~pantheios_initialiser()':
/home/awishformore/code/pantheios/include/pantheios/./internal/initialiser.hpp:133: undefined reference to `pantheios_uninit'

这是我的makefile为链接生成的代码行:

代码语言:javascript
复制
g++ -Wall -g -I/home/awishformore/code/stlsoft/include -I/home/awishformore/code/pantheios/include -I/home/awishformore/code/boost_1_54_0 -I/home/awishformore/code/mysql/include -L/home/awishformore/code/pantheios/lib -L/home/awishformore/code/mysql/lib -L/home/awishformore/code/boost_1_54_0/lib -lpantheios.1.core.gcc46.file64bit.mt -lpantheios.1.fe.simple.gcc46.file64bit.mt -lpantheios.1.be.fprintf.gcc46.file64bit.mt -lpantheios.1.bec.fprintf.gcc46.file64bit.mt -lpantheios.1.core.gcc46.file64bit.mt -lpantheios.1.util.gcc46.file64bit.mt main.o Database.o -o engine

我真的看不出有什么问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-07-24 23:02:48

在这个问题上浪费了几个小时之后,我终于在这个small, inconspicuous post中找到了答案。

由于pantheios的构建方式和gcc的工作方式,这些库需要出现在链接命令中的对象文件后面,如下所示:

代码语言:javascript
复制
g++ <compiler flags> <include paths> main.o <other objects> <library paths> <libraries> -o main

当我尝试这样做时,错误变成了未定义的pthread引用,这也可以通过链接pthread库轻松地解决。

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

https://stackoverflow.com/questions/17705362

复制
相关文章

相似问题

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