2013-07-17 37 views
1

我已经阅读了几乎所有与此相关的帖子。正如许多地方所建议的那样,我连接到核心库两次。我只是无法弄清楚问题所在。这里的错误:链接问题与pantheios - undefined参考pantheios_init

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生成链接线:

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 

我实在看不出有什么错呢?

回答

1

经过几小时和几个小时的浪费,我终于在这个small, inconspicuous post找到了答案。

由于道路pantheios是建立和方式GCC工程,图书馆需要出现在链接命令中的目标文件后面,如下所示:

g++ <compiler flags> <include paths> main.o <other objects> <library paths> <libraries> -o main 

当我试过了,错误改为未定义的pthread引用,这也很容易通过链接到pthread库来解决。

+0

哦,天啊,感谢这篇文章。我很高兴我不必去找那个小而不显眼的帖子,而是在这里寄宿你的快乐答案! –