boost自动链接如何做出选择?

2023-07-20C/C++开发问题
6

本文介绍了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,或者我想要一个带有 gdsgd 的名字?

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自动链接如何做出选择?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6