MeM*_*MeM 15 c++ boost build jenkins
我正在尝试构建boost并生成dll,但无论我做了什么都没有解决问题.
在这里我得到了:
创建库bin.v2\libs\thread\build\msvc-11.0\dbg\adrs-mdl-32\async-excpt-on\thrd-mlt\boost_thread-vc110-mt-gd-1_53.lib和object bin.v2\libs\thread\build\msvc-11.0\dbg\adrs-mdl-32\async-excpt-on\thrd-mlt\boost_thread-vc110-mt-gd-1_53.exp thread.obj:错误LNK2019:未解析的外部符号"__declspec(dllimport)public:__ thiscall boost :: gregorian :: greg_month :: greg_month(unsigned short)"(_ imp ?? 0greg_month @ gregorian @ boost @@ QAE @ G @ Z)在函数"public:__thiscall boost: :gregorian :: date :: date(enum boost :: date_time :: special_values)"(?? 0date @ gregorian @ boost @@ QAE @ W4special_values @ date_time @ 2 @@ Z)thread.obj:错误LNK2019:未解析的外部符号"__declspec(dllimport)public:__ thiscall boost :: gregorian :: greg_month :: operator unsigned short(void)const"(_ imp ?? Bgreg_month @ggorgorian @ boost @@ QBEGXZ)函数__catch $?make_external_thread_data @?A0x9b8c45f0 @ boost @@ YAXXZ $ 0 bin.v2\libs\thread\build\msvc-11.0\dbg\adrs-mdl-32\async-excpt-on\thrd-mlt\boost_ thread-vc110-mt-gd-1_53.dll:致命错误LNK1120:2个未解析的外部
这里有一些关于设置的信息:
操作系统:W7 x64
构建命令:
b2 -j%NUMBER_OF_PROCESSORS% - 简称路径工具集= msvc-11.0 define = _SECURE_SCL = 0 define = _CRT_SECURE_NO_DEPRECATE define = _CRT_SECURE_NO_WARNINGS --without-mpi address-model = 32 variant = debug install link = shared runtime-link = shared threading = multi asynch-exceptions = on exception-handling = 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
以前是否有人遇到过这样的问题?我真的找不到任何地方的东西?
编辑:
有关于我的问题的更新.我可以构建它以便发布.我唯一改变的是这里:
b2 -j%NUMBER_OF_PROCESSORS%--abbreviate-paths toolset = msvc-11.0 define = _SECURE_SCL = 0 define = _CRT_SECURE_NO_DEPRECATE define = _CRT_SECURE_NO_WARNINGS --without-mpi address-model = 32 variant = release install link = shared runtime-link = shared threading = multi asynch-exceptions = on exception-handling = on extern-c-nothrow = off --prefix = ..\boost cd ..
可能是什么问题呢?我该如何解决?
提前感谢任何建议.
其实我已经找到了解决办法:
我使用 bjam 的方式是正确的,足以动态构建 boost。在那个阶段,我不应该定义任何东西。编译后,我更改了 user.hpp 和 #define BOOST_ALL_DYN_LINK。这样我自己的项目(正在使用 boost)就会明白 boost 是动态的。这就是应该如何构建 boost 的方式。
这似乎是最好的方法,因为 boost 会按预期自动解码必要的库和 dll,并且运行良好。