简体   繁体   English

使用Boost线程时的链接器错误

[英]Linker error when using boost threads

I'm trying to use the boost threads, but when running the program i get this: 我正在尝试使用Boost线程,但是在运行程序时我得到了以下信息:

LINK : fatal error LNK1104: cannot open file 'libboost_date_time-vc100-mt-gd-1_46.lib'

The directories I've included in the linker, are: c:\\boost_1_46_0\\libs\\ and c:\\boost_1_46_0\\boost. 我包含在链接器中的目录是:c:\\ boost_1_46_0 \\ libs \\和c:\\ boost_1_46_0 \\ boost。
And I am using Visual Studio Express 2010. 我正在使用Visual Studio Express 2010。

Thanks. 谢谢。

Specify $(BOOSTROOT)/lib as 'additional library directory' for the linker. 将$(BOOSTROOT)/ lib指定为链接器的“附加库目录”。 ( Note: it is NOT libs with an s ) (注意:它不是带有s的库)

This assumes that you have built the boost libraries using the visual studio compiler. 假设您已经使用Visual Studio编译器构建了boost库。 From the discussion in the comments, it seems you have not done this. 从评论中的讨论来看,您似乎还没有这样做。

I recomend, instead of trying to build the libraries yourself, you use the installer to get pre-built binaries. 我建议,您可以使用安装程序来获取预构建的二进制文件,而不是尝试自己构建库。 Here is the installer: http://www.boostpro.com/download/ 这是安装程序: http : //www.boostpro.com/download/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM