【问题标题】:Why am I getting this error with MinGW and Cmake?为什么我在使用 MinGW 和 Cmake 时收到此错误?
【发布时间】:2021-08-24 08:00:14
【问题描述】:

所以我试图用搅拌机编译这个翻转流体插件,所以我遵循了这个教程,https://www.youtube.com/watch?v=TVKM1egDoGs,所以我首先运行cmake.exe -G "MinGW Makefiles" ..,它告诉我它缺少一个 CMakeLists 文件......所以我添加了一个...然后我运行cmake.exe --build .,它比向我显示的错误达到了 3%...

In file included from C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/threadutils.h:29,
                 from C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/meshlevelset.h:65,
                 from C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/meshobject.h:30,
                 from C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/fluidsimulation.h:38,
                 from C:\Users\N\Downloads\Blender-FLIP-Fluids-master\src\engine\c_bindings\fluidsimulation_c.cpp:25:
C:/PROGRA~2/MINGW-~1/I686-8~1.0-P/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/c++/mutex:93:9: note: previous definition of 'class std::recursive_mutex'
   class recursive_mutex : private __recursive_mutex_base
         ^~~~~~~~~~~~~~~
In file included from C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/mingw32_threads/mingw.condition_variable.h:25,
                 from C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/threadutils.h:31,
                 from C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/meshlevelset.h:65,
                 from C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/meshobject.h:30,
                 from C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/fluidsimulation.h:38,
                 from C:\Users\N\Downloads\Blender-FLIP-Fluids-master\src\engine\c_bindings\fluidsimulation_c.cpp:25:
C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/mingw32_threads/mingw.mutex.h:142:44: error: conflicting declaration 'typedef class std::_NonRecursive<std::recursive_mutex> std::mutex'

这是完整的错误https://pastebin.com/KTnALG1E,这是从哪里来的??是mingw错误还是什么?有人可以帮忙吗?

【问题讨论】:

    标签: c++ windows cmake mingw


    【解决方案1】:

    您的完整错误消息包含一个更有趣的部分:

    C:/Users/N/Downloads/Blender-FLIP-Fluids-master/src/engine/mingw32_threads/mingw.thread.h:32:2: 错误:#error 这个版本的 MinGW 似乎包含一个 win32 端口 pthreads,并且可能已经有 C++11 标准线程类 基于 pthread 实现。你很可能会上课 下面的重新定义错误,不幸的是这个实现可以 不能独立使用且独立于系统标头, 因为它依赖于 std::unique_lock 和其他实用程序类。 如果您仍想使用此实现(因为它更 轻量级),你必须编辑你的 c++-config.h 系统头文件 MinGW 不定义 _GLIBCXX_HAS_GTHREADS。这将阻止系统 来自定义实际线程类的标头,同时仍在定义 必要的实用程序类。

    因此,要么安装不同版本的 mingw,要么根据上述说明编辑您的 mingw 文件。

    【讨论】:

    • 那么既然有一个mingw32_threads文件夹,我要下载32位的版本吗?我该怎么做?
    猜你喜欢
    • 2014-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-13
    • 2018-06-22
    相关资源
    最近更新 更多