在cMake中使用boost.asio [英] Using boost.asio in cMake
本文介绍了在cMake中使用boost.asio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对cMake还是比较陌生,我正在尝试在我的项目中使用boost asio库.
I am relatively new to cMake, and I'm trying use the boost asio library in my project.
我能够让cMake找到其他boost库,例如smart_ptr和lexical_cast,但是当我尝试包含boost/asio.hpp
时,却出现了链接器错误:
I was able to get cMake to find other boost libraries such as smart_ptr and lexical_cast, but I get a linker error when I try to include boost/asio.hpp
:
LINK : fatal error LNK1104: cannot open file 'libboost_system-vc90-mt-1_40.lib'.
然后我尝试从
find_package(Boost 1.40.0 REQUIRED)
到
find_package(Boost 1.40.0 REQUIRED COMPONENTS asio)
然后
cMake要求输入Boost_ASIO_LIBRARY_DEBUG
和Boost_ASIO_LIBRARY_RELEASE
.我会以正确的方式这样做吗?如果是这样,我应该在哪里指向cMake查找这些库. (我正在使用cMake 2.6和Boost 1.40.0)
cMake then asks for Boost_ASIO_LIBRARY_DEBUG
and Boost_ASIO_LIBRARY_RELEASE
. Am I going about this the right way, and if so where should I point cMake to find these libraries. (I am using cMake 2.6 and boost 1.40.0)
推荐答案
查看全文