c++编译错误.g++ gnu

C++ compile error. G++ gnu

本文关键字:gnu g++ 错误 编译 c++      更新时间:2023-10-16

你好,我的c++程序有一些问题。我正在使用g++ gnu,它是在windows 10上。下面是显示的错误:

ld.exe:无法找到-lpthreadCollect2.exe: error: ld returned 1 exit status

请帮忙,因为我不知道是怎么回事。

谢谢,亚设

这是链接器错误。不是编译器错误。它抱怨在库搜索路径中找不到pthread库。要么它根本不存在,要么你需要用-L选项指出它在哪里。或者,在不需要pthread的情况下,删除-lpthread选项,这样您就不会试图链接到它。