Boost mingw 链接错误
我似乎在 Windows 上使用 mingw 链接到 boost 库时遇到问题。我在谷歌和 stackoverflow 上到处搜索,但没有一个答案解决了问题。
它找不到或链接到“-lboost_threads”。编译时出现“未定义错误”。
也许知道如何的人可以帮我解决这个问题。
在 Windows 上使用 boost v1.48 和 mingw。
编辑:
错误是“...mingw32/bin/ld.exe 找不到 -lboost_thread”,在这种情况下通常可能会出现这种情况。
谢谢。
I seem to have a problem linking to boost libs using mingw on windows. I search high and low on google and stackoverflow but none of the answers solved the problem.
It can't find or link to "-lboost_threads". Getting an "undefined error" when compiling.
Maybe someone who knows howto can help me solve it.
Using boost v1.48 and mingw on windows.
EDIT:
Error being "...mingw32/bin/ld.exe cannot find -lboost_thread", as it probably usually would in this case.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
链接器命令行参数
-lboost_thread
表示链接器应在其库路径
(您可以使用-Lpath 添加)中查找
。它尝试在具有以下文件名之一的文件中查找库:boost_thread
/to/librarylibboost_thread.a
(GCC 类型存档库 - 这是您在本例中需要的) )boost_thread.lib
(MSVC 库 - 请注意,如果它们是 C 语言,而不是 C++ 语言,MinGW 可以链接它们))无论如何,此错误消息意味着链接器无法在包含路径中找到此类库。检查库文件所在位置(你应该知道);如果它位于编译器的 lib 文件夹中,那么它已经位于链接器可以找到它的位置。也许你把名字拼错了?否则添加适当的
-L
命令行参数,以便链接器知道在哪里查找文件。(还有 boost_thread 或 boost_threads?)
The linker command line argument
-lboost_thread
means that the linker shall lookboost_thread
in itslibrary paths
(which you can add using-Lpath/to/library
. It tries to find the library in a file with one of the following filenames:libboost_thread.a
(GCC-type archive library - this is what you need in this case)boost_thread.lib
(MSVC libs- note that MinGW can link them if they're in C, not C++))Anyway, this error message means that the linker cannot find such library in the include paths. Check where the library file is located (you should know that); if it's in your compiler's
lib
folder, then it's already in a place where your linker would find it. Maybe you've misspelled the name? Otherwise add an appropriate-L
command line argument so that the linker would know where to look for the file.(Also boost_thread or boost_threads?)