当我使用 Visual Studio 2012 时,通过自动链接,我不需要手动添加 boost/POCO/python 库,它们会自动添加.如果我错过任何图书馆,我会收到这样的消息:
When I use Visual Studio 2012, with auto-linking, I don't need to add boost / POCO/ python libraries manually, they would be added automatically. And if I miss any library, I get message like that:
链接:致命错误 LNK1104:无法打开文件libboost_system-vc110-mt-1_55.lib"
LINK : fatal error LNK1104: cannot open file 'libboost_system-vc110-mt-1_55.lib'
但是它怎么知道我要链接哪个文件呢?也许我想动态链接,使用 boost_system-vs110-mt-1_55.lib,或者我想要一个带有 gd 或 sgd 的名字?
But how it knows which file I want to link? Maybe I want to link dynamically, using boost_system-vs110-mt-1_55.lib, or I want one with gd or sgd in name?
它是如何做出选择的?
问题是,我的程序在搜索系统、线程等时正在寻找 libboost_ ...(即静态)库,但它想要 python 的 boost_(即动态),我只是不明白为什么?
Problem is, that my program is looking for libboost_ ... (i.e. static) libraries, when search for system, threads and etc, but it wants boost_ (i.e. dynamic) for python, and I just don't understand why?
Visual Studio 允许在源代码中使用 #pragma
指令来设置链接器选项.对于自动链接",Boost 将这些 #pragma's
与现有的宏结合使用.
Visual Studio allows #pragma
directives in the source code to set linker options. For "auto-linking", Boost uses these #pragma's
in combination with existing macro's.
特别是,听起来您正在寻找 BOOST_ALL_DYN_LINK
宏.
In particular, it sounds like you are looking for the BOOST_ALL_DYN_LINK
macro.
这篇关于boost自动链接如何做出选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!