问题
I'm trying to compile the Scotch partitioning library on Windows with the Mingw gcc toolchain (tried using both TDM GCC 5.1 and MSYS2 GCC 8.3) with identical issues (compiling on linux works fine).
Scotch uses parsing with regex and depends on regex.h and associated bits which do not seem to be set up by default in the Mingw setup, resulting in the error
dummysizes.c:88:19: fatal error: regex.h: No such file or directory
So adding for example "-IC:\msys64\mingw64\include\c++\8.3.0\bits" to the compilation flags gets me further, but now can't find regex.tcc
fatal error: bits/regex.tcc: No such file or directory
Changing the include line in regex.h allows locating regex.tcc, however now the parsing seems to be completely off, with errors such as
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)
^
I have also tried using g++ instead of gcc to enforce c++ behaviour but also results in errors. Somehow it seems the toolchain is not properly set up for using regex but can't seem to get it right.
Does anyone have any idea that could be the issue/fix?
来源:https://stackoverflow.com/questions/56712014/issues-compiling-scotch-with-mingw-toolchain-on-windows