构建增压动态可链接会产生链接错误

Building Boost dynamically linkable gives linking error?

本文关键字:链接 错误 动态 构建      更新时间:2023-10-16

我正在尝试构建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上创建了一个问题,让我们看看。