编译TestProxy时候遇到链接错误
2017-09-13 14:15
197 查看
问题表现:
4>libeventmanager.lib(CommandLoop.obj) : error LNK2019: unresolved external symbol "double __cdecl tn::simple_time::steady_time(void)" (?steady_time@simple_time@tn@@YANXZ) referenced in function "public: bool __thiscall Tn::EventManager::CommandLoop::runNextCommand(void)"(?runNextCommand@CommandLoop@EventManager@Tn@@QAE_NXZ)
4>libeventmanager.lib(CommandLoop.obj) : error LNK2019: unresolved external symbol "bool __cdecl tn::simple_time::wait_for(class boost::condition_variable &,class boost::unique_lock<class boost::mutex> &,double)" (?wait_for@simple_time@tn@@YA_NAAVcondition_variable@boost@@AAV?$unique_lock@Vmutex@boost@@@4@N@Z)
referenced in function "public: void __thiscall Tn::EventManager::CommandLoop::run(unsigned int)" (?run@CommandLoop@EventManager@Tn@@QAEXI@Z)
4>D:\RhineSDKTrunk\bindings\cpp-events\TestProxy\build\TestProxy-win32\Debug\TestProxy.dll : fatal error LNK1120: 2 unresolved externals
问题原因:
大部分链接的问题都是找不到函数的定义,这里是找不到steady_time()函数的定义解决方法:
在cmakelist.txt 里面增加下面内容,增加引用库libfoundation.lib, steady_time()的定义就在这个库里面target_link_libraries(TestProxy
debug ${PROJECT_SOURCE_DIR}/../../modules/${TNPLATFORM}/lib/debug/libfoundation.lib
optimized ${PROJECT_SOURCE_DIR}/../../modules/${TNPLATFORM}/lib/release/libfoundation.lib)
相关文章推荐
- 【学习Android遇到的错误】import 的时候出现“no projects are found to import”
- 论try/catch的重要性,我们经常遇到代码出现无法调试的错误,程序退出的时候崩溃。这跟我们代码日常保护的习惯息息相关。
- vs2012编译基于CGAL4.8.1应用时候最后出现链接错误_imp_gmpq_init等解决
- 构建ssm的时候遇到的错误一
- 使用scrapy写好爬虫进行工作的时候,遇到错误及解决方法
- 给表空间增加数据文件的时候遇到ORA-00470错误,数据库也崩溃了!
- 使用 SDL 过程中遇到的两个问题: 找不到main函数 和 链接错误
- 使用log4cplus时遇到的链接错误:无法解析的外部符号 "public: static class log4cplus::Logger __cdecl log4cplus::Logger::getInstance(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,
- VC++经常会遇到的链接错误LNK2001
- 重写View的时候遇到inflate的错误
- git pull命令更新本地项目的时候遇到“No remote repository specified……”的错误
- 启动Tomcat的时候遇到错误
- cmake编译 opencv_contrib-master时候遇到错误
- 学习VC++时经常会遇到链接错误LNK2001
- 从爬网时候遇到的一个问题看如何找到错误的根源
- MySQL在导入的时候遇到的错误
- 安装MySQL的时候遇到的错误
- VC++ 遇到链接错误LNK2001
- 学习VC++时经常会遇到链接错误LNK2001
- ubuntu: apt-get update的时候遇到“Hash Sum mismatch”错误