gpt4 book ai didi

c++ - 为什么 boost 寻找 libboost_*.lib 而不是 boost_*.lib?

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:50:18 26 4
gpt4 key购买 nike

我使用标记布局编译了 boost 库,因此我有 boost_program_options-mt.lib 形式的库文件。我假设问题是 boost_auto_link 之类的。我有预处理器定义 BOOST_AUTO_LINK_TAGGED,尽管我仍然收到错误消息说 Visual Studio 正在寻找 libboost 版本并且无法打开文件。

Error   LNK1104 cannot open file 'libboost_program_options-mt.lib'  

我该如何解决这个问题才能正确链接到库?

UPDATE: For some reason, when I launch my program, I get an error saying that boost_system-mt.dll is missing from my computer. This is very weird since I am not linking to the dynamic libraries, nor do I have dynamic libraries included in my additional libraries directory.

最佳答案

来自提到的 boost 文档 here :

BOOST_ALL_NO_LIB
Tells the config system not to automatically select which libraries to link against. Normally if a compiler supports #pragma lib, then the correct library build variant will be automatically selected and linked against, simply by the act of including one of that library's headers. This macro turns that feature off.

因此,我认为如果您在预处理器定义中定义BOOST_ALL_NO_LIB,然后将库的路径添加到您的库路径列表中,就会解决问题。

关于c++ - 为什么 boost 寻找 libboost_*.lib 而不是 boost_*.lib?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41193447/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com