构建增压动态可链接会产生链接错误
Building Boost dynamically linkable gives linking error?
我正在尝试构建boost并生成DLL,但是我所做的一切都无法解决问题。
这里我得到的:
创建图书馆bin.v2 libs thread build msvc11.0 dbg dbg adrs-mdl-32 async-excpt-on thrd-mlt thrd-mlt boost_thread-vc110-mt-vc110-mt-gd-gd-1_53.lib和对象bin.v2 libs thread build msvc-11.0 dbg adrs-mdl-32 async-excpt-on thrd-mlt boost_thread-vc110-mt-vc110-mt-gd-gd-1_53.expext thread.obj:错误lnk2019:未解决的外部符号" __declspec(dllimport)public:__ thiscall boost :: gregorian :: greg_month :: greg_month :: greg_month(unsigned short)@@ qae@g@z)在函数中引用"公共:__thiscall boost :: gregorian :: date :: date :: date(enum boost :: date_time :: special_values)"(?? 0date@gregorian@boost@boost@boost@boost@qae@w4special_values@w4special_values@w4special_values@w4special_values@w4special_values@w4special_values@date_time@2 @@ z) thread.obj:错误lnk2019:未解决的外部符号" __declspec(dllimport)public:__ thiscall boost :: gregorian :: greg_month :: greg_month ::操作员unsigned short(void)const"@boost @@ qbegxz)在函数中引用__catch $?make_external_thread_data@?a0x9b8c45f0@boost@boost @@ yaxxz $ 0 bin.v2 libs thread build msvc-11.0 dbg adrs-mdl-32 async-excpt-on thrd-mlt thrd-mlt boost_thread-vc110-mt-vc110-mt-vc1-mt-gd-gd-1_53.dll:致命错误lnk1120:2 unnk1120:2 unresolved外部
在这里,有关设置的一些信息:
OS:W7 x64
命令要构建:
=共享螺纹=多Asynch-Exceptions = on Exception andling = on Extern-C-Nothrow = OFF -PREFIX = .. boost CD ..
我已经安装了Cygwin。
到现在我尝试过的东西;
*我试图在32位命令窗口中构建它(我正在使用Jenkins来构建Boost)
*我在boost config/user.hpp
中写下#define boost_all_dyn_link*我在boost config/user.hpp
中写下#define boost_all_no_lib有没有人遇到过这样的问题?我真的在任何地方都找不到什么?
编辑:
有关于我的问题的更新。我可以构建它以供发布。我更改的唯一一件事是:
安装链接=共享运行时link =共享螺纹=多asynch-exceptions = on Exception handling = on extern-c-nothrow = off -prefix = .. boostCD ..有什么问题?我该如何解决?
预先感谢您的任何建议。
实际上我找到了解决方案:
我使用BJAM的方式是正确的,足以动态地构建增强功能。在那个阶段,我不应该定义任何东西。编译后,我更改user.hpp和#define boost_all_dyn_link。这样,我自己的项目(使用Boost)就会理解Boost是动态的。这就是应建造增强的方式。
这似乎是最好的方法,因为Boost会根据预期自动解码必要的LIB和DLL。
我看到成功的增强构建涉及许多手动步骤。如果您不想遵循这些手动步骤并避免开销,请尝试使用BlueGo,前提是您要使用MSVC工具集。BlueGo允许配置32/64位,调试/发布模式等。
我再次遇到了这个问题。以前我使用的是Boost 1.54。现在 - 提升1.71。我认为真正的原因是boost::thread
依赖项列表缺少boost::date_time
。两个版本对我有用的是将以下几行添加到libs/thread/build/Jamfile.v2
中的requirements
规则的底部:
if <target-os>windows in $(properties)
{
result += <define>BOOST_THREAD_USES_DATE_TIME ;
result += <library>/boost/date_time//boost_date_time ;
}
我已经在github上创建了一个问题,让我们看看。
- 静态数据成员的问题-修复链接错误会导致编译器错误
- Visual Studio mkl_link_tool.exe链接错误
- C++ 实现模板单例类时出现链接错误
- 使用类模板的方法链接错误
- MySQL C++连接器链接错误
- VS 2015 链接错误 无法构建依赖于 libcurl 的项目
- 运行 C++ 单元测试时LNK2005链接错误
- 对 CMake 中'cudaRegisterLinkedBinary'链接错误的未定义引用?
- 链接错误,包括我创建的相同头文件 - C++
- 在Embarcadero C++ Builder中生成的DLL未解决的外部链接错误
- 使用标头保护的多个定义链接错误
- 链接错误:未定义对 stdscr 和 wgetch 的引用
- 使用 Vivek 的 Vcam / 捕获源过滤器构建/链接错误
- 升压program_options中的链接错误
- 使用 g++ 预处理器进行替换会导致链接错误
- 在调试配置中编译工作正常,但发布会给出链接错误
- 相邻矩阵设置链接错误
- 包含常量变量并包含在多个文件中的标头的链接错误
- C++链接错误,我理解但无法解决
- 是什么导致macOS Mojave上的GoogleTest链接错误