如何链接到动态提升库?

2023-06-29C/C++开发问题
7

本文介绍了如何链接到动态提升库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我编译了 boost lib 并得到了这些.

I compiled boost lib and got these.

//Shared/dynamic link libraries

24/03/2010  11:25 PM            53,248 boost_thread-vc80-mt-1_42.dll
24/03/2010  11:25 PM            17,054 boost_thread-vc80-mt-1_42.lib
24/03/2010  11:25 PM            17,054 boost_thread-vc80-mt.lib

24/03/2010  11:25 PM            73,728 boost_thread-vc80-mt-gd-1_42.dll
24/03/2010  11:25 PM            17,214 boost_thread-vc80-mt-gd-1_42.lib
24/03/2010  11:25 PM            17,214 boost_thread-vc80-mt-gd.lib

// Static libs... does not need any dlls

24/03/2010  11:25 PM           381,716 libboost_thread-vc80-mt-1_42.lib
24/03/2010  11:25 PM           381,716 libboost_thread-vc80-mt.lib

24/03/2010  11:25 PM           999,552 libboost_thread-vc80-mt-gd-1_42.lib
24/03/2010  11:25 PM           999,552 libboost_thread-vc80-mt-gd.lib

24/03/2010  11:25 PM           421,050 libboost_thread-vc80-mt-s-1_42.lib
24/03/2010  11:25 PM           421,050 libboost_thread-vc80-mt-s.lib

24/03/2010  11:25 PM         1,015,688 libboost_thread-vc80-mt-sgd-1_42.lib
24/03/2010  11:25 PM         1,015,688 libboost_thread-vc80-mt-sgd.lib

在 Visual Studio 中,我使用 boost 线程库编写了一个测试应用程序.基于代码生成设置,它只要求这四个库(如多线程调试、多线程、多线程调试 dll 和多线程 dll)

In Visual Studio, I have written a test app using the boost thread library. Based on code generation settings it asks for these four libs only (like multithreading debug, multithreading, multithreading debug dll, and multithreading dll)

24/03/2010  11:25 PM           381,716 libboost_thread-vc80-mt-1_42.lib
24/03/2010  11:25 PM           381,716 libboost_thread-vc80-mt.lib

24/03/2010  11:25 PM           999,552 libboost_thread-vc80-mt-gd-1_42.lib
24/03/2010  11:25 PM           999,552 libboost_thread-vc80-mt-gd.lib

24/03/2010  11:25 PM           421,050 libboost_thread-vc80-mt-s-1_42.lib
24/03/2010  11:25 PM           421,050 libboost_thread-vc80-mt-s.lib

24/03/2010  11:25 PM         1,015,688 libboost_thread-vc80-mt-sgd-1_42.lib
24/03/2010  11:25 PM         1,015,688 libboost_thread-vc80-mt-sgd.lib

现在我的问题是如何将我的应用程序链接到其他 2 个库以便它使用 dll?

Now my question is how can I link my app to the other 2 libs so that it uses the dlls?

24/03/2010  11:25 PM            53,248 boost_thread-vc80-mt-1_42.dll
24/03/2010  11:25 PM            17,054 boost_thread-vc80-mt-1_42.lib
24/03/2010  11:25 PM            17,054 boost_thread-vc80-mt.lib

24/03/2010  11:25 PM            73,728 boost_thread-vc80-mt-gd-1_42.dll
24/03/2010  11:25 PM            17,214 boost_thread-vc80-mt-gd-1_42.lib
24/03/2010  11:25 PM            17,214 boost_thread-vc80-mt-gd.lib

问题 2. g、s 代表什么?

Question 2. What does the g, s stands for?

推荐答案

您可以通过定义 BOOST_ALL_DYN_LINK 来强制 Boost 使用 DLL - 无论是在您的 C++ 预处理器设置中还是通过 #define 在你的 stdafx.h 预编译头文件中,例如:

You can force Boost to use the DLLs by defining BOOST_ALL_DYN_LINK - either in your C++ preprocessor settings or by a #define in your stdafx.h pre-compiled header, e.g.:

#define BOOST_ALL_DYN_LINK

这篇关于如何链接到动态提升库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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