Issues compiling Scotch with mingw toolchain on Windows

给你一囗甜甜゛ 提交于 2019-12-23 05:37:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!