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自动链接如何做出选择?


基础教程推荐
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01