How boost auto-linking makes choice?(boost自动链接如何做出选择?)
问题描述
当我使用 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自动链接如何做出选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:boost自动链接如何做出选择?
基础教程推荐
- 将不可复制的闭包对象传递给 std::function 参数 2021-01-01
- 提升 ASIO 流缓冲 2021-01-01
- c++ STL设置差异 2022-01-01
- 为什么我们不能使用“虚拟继承"?在 COM 中? 2022-01-01
- 如何更改 SysDateTimePick32 或 CDateTimeCtrl 的背景颜色? 2022-01-01
- 如何在 C++ 中正确使用命名空间? 2022-01-01
- C++:获取传递给函数的多维数组的行大小 2021-01-01
- 随机插入/删除的综合向量与链表基准 2022-01-01
- 与 CAS 的原子交换(使用 gcc 同步内置函数) 2022-01-01
- 如何部分禁用 cmake C/C++ 自定义编译器检查 2021-01-01
