在Windows上使用mingw工具链编译Scotch的问题

时间:2019-06-22 01:52:03

标签: regex gcc compilation mingw

我正在尝试使用Mingw gcc工具链(同时使用TDM GCC 5.1和MSYS2 GCC 8.3尝试)在Windows上编译Scotch partitioning library,但存在相同的问题(在Linux上正常工作)。

Scotch使用正则表达式进行解析,并依赖于regex.h和相关联的位,这些位似乎未在Mingw设置中默认设置,从而导致错误

dummysizes.c:88:19: fatal error: regex.h: No such file or directory

因此在编译标志中添加例如“ -IC:\ msys64 \ mingw64 \ include \ c ++ \ 8.3.0 \ bits”会使我更进一步,但现在找不到regex.tcc

fatal error: bits/regex.tcc: No such file or directory

更改 regex.h 中的include行可以找到 regex.tcc ,但是现在解析似乎已经完全结束,出现了诸如

之类的错误
C:\msys64\mingw64\include\c++\bits/regex.h:31:1: error: unknown type name 'namespace'
 namespace std _GLIBCXX_VISIBILITY(default)
 ^
C:\msys64\mingw64\include\c++\bits/regex.h:31:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '_GLIBCXX_VISIBILITY'
 namespace std _GLIBCXX_VISIBILITY(default)
               ^

我还尝试使用g ++而不是gcc来强制c ++行为,但也会导致错误。不知何故,似乎未正确设置使用正则表达式的工具链,但似乎无法正确使用它。

有人有可能是问题/解决方案的想法吗?

0 个答案:

没有答案