c++ - 如何配置 Eclipse 以使用特定的 MinGW 工具链

标签 c++ c++11 mingw eclipse-cdt

所以我花了一整天的时间试图让 c++ 线程与 eclipse Kepler 和 mingw 一起工作。我已经尝试添加 -std=c++11 标志、-lpthread 标志、另一个标志,甚至在表 GXX_EXPERIMENTAL_CXX0X 中添加了一个符号。我最近尝试让线程工作是遵循这个建议 std::thread is not a member of namespace std using Eclipse Kepler MinGW

上面写着:

Plain MinGW cannot support std::thread. You will need to use a MinGW-w64 toolchain (such as those shipped with Qt 5) that has "posix" threading enabled, so that libstdc++ exposes the thread, mutex and future functionality. You can find an installer here.

现在我有一个名为: C:\Program Files\mingw-builds\x64-4.8.1-posix-seh-rev5 我如何让它与 eclipse 一起工作以便我可以使用线程?我是否必须替换我的 mingw 文件中的某些内容或以某种方式将其链接到 eclipse?我什至不知道从哪里开始。如果建议这样做,那就别管了。

最佳答案

看看这个FAQ

我认为这与您想要做的事情一致,因为基本上您需要向 eclipse 显示不同版本的 MinGW。看来您需要正确设置 PATH 变量,以便 eclipse 可以找到新版本。

关于c++ - 如何配置 Eclipse 以使用特定的 MinGW 工具链,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20945832/

相关文章:

c++ - 如何在 C++ 中检测 map 中给定位置的面积?

c++ - bool 在位域定义中安全吗?

c++ - 如何绕过成员函数末尾对析构函数的调用?

c++ - 如何将gsl添加到MinGW?

c++ - 为什么 MinGW 的 std::to_string() 运行速度比 VS2012 慢 16 倍

c++ - DirectoryIterator 可能存在的错误

c++ - 如何在运行时链接期间从我的 DLL 调用函数?

c++ - 如何修复 -Wsubobject-linkage 警告?

c++ - 前循环迭代对当前迭代执行时间的影响

c++ - Glvalue实例和解释?