How to link to dynamic boost libs?(如何链接到动态提升库?)
问题描述
我编译了 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
这篇关于如何链接到动态提升库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何链接到动态提升库?
基础教程推荐
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 从 std::cin 读取密码 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01