如何链接到动态升压库? [英] How to link to dynamic boost libs?
问题描述
我编译升压lib和得到这些。
//共享/动态链接库24/03/2010下午11时25 53,248 boost_thread-VC80-MT-1_42.dll
24/03/2010下午11时25 17054 boost_thread-VC80-MT-1_42.lib
24/03/2010下午11时25 17054 boost_thread-VC80-mt.lib24/03/2010下午11时25 73,728 boost_thread-VC80-MT-GD-1_42.dll
24/03/2010下午11时25 17214 boost_thread-VC80-MT-GD-1_42.lib
24/03/2010下午11时25 17214 boost_thread-VC80-MT-gd.lib//静态库......不需要任何DLL24/03/2010下午11时25 381716 libboost_thread-VC80-MT-1_42.lib
24/03/2010下午11时25 381716 libboost_thread-VC80-mt.lib24/03/2010下午11时25 999552 libboost_thread-VC80-MT-GD-1_42.lib
24/03/2010下午11时25 999552 libboost_thread-VC80-MT-gd.lib24/03/2010下午11时25 421050 libboost_thread-VC80-MT-S-1_42.lib
24/03/2010下午11时25 421050 libboost_thread-VC80-MT-s.lib24/03/2010下午11时25 1015688 libboost_thread-VC80-MT-SGD-1_42.lib
24/03/2010下午11时25 1015688 libboost_thread-VC80-MT-sgd.lib
在Visual Studio中,我已经写了使用升压线程库的测试应用程序。在此基础上要求只有这四个库code生成设置(如多线程调试,多线程,多线程调试的dll和多线程DLL)
24/03/2010下午11点25 381716 libboost_thread-VC80-MT-1_42.lib
24/03/2010下午11时25 381716 libboost_thread-VC80-mt.lib24/03/2010下午11时25 999552 libboost_thread-VC80-MT-GD-1_42.lib
24/03/2010下午11时25 999552 libboost_thread-VC80-MT-gd.lib24/03/2010下午11时25 421050 libboost_thread-VC80-MT-S-1_42.lib
24/03/2010下午11时25 421050 libboost_thread-VC80-MT-s.lib24/03/2010下午11时25 1015688 libboost_thread-VC80-MT-SGD-1_42.lib
24/03/2010下午11时25 1015688 libboost_thread-VC80-MT-sgd.lib
现在我的问题是如何将我的应用程序链接到其他2库,以便它使用的DLL文件?
24/03/2010下午11时25分53,248 boost_thread-VC80-MT-1_42.dll
24/03/2010下午11时25 17054 boost_thread-VC80-MT-1_42.lib
24/03/2010下午11时25 17054 boost_thread-VC80-mt.lib24/03/2010下午11时25 73,728 boost_thread-VC80-MT-GD-1_42.dll
24/03/2010下午11时25 17214 boost_thread-VC80-MT-GD-1_42.lib
24/03/2010下午11时25 17214 boost_thread-VC80-MT-gd.lib
问题2.什么的G,S代表什么吗?
您可以强制加速通过定义 BOOST_ALL_DYN_LINK
来使用DLL的 - 无论是在你的C ++ preprocessor
的stdafx.h
pre-编译头,例如设置或> 的#define BOOST_ALL_DYN_LINK
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
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
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
Question 2. What does the g, s stands for?
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
这篇关于如何链接到动态升压库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!