I’m trying to build my VTK library with Qt6 and mingw-64 compiler.
When I launch my build, with any version (9.3.x) of VTK the following error appears:
UserPath\vtk\Utilities\KWSys\vtksys\SystemTools.cxx:3296:30: error: 'ERROR_SYMLINK_NOT_SUPPORTED' was not declared in this scope
return Status::Windows(ERROR_SYMLINK_NOT_SUPPORTED);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
UserPath\vtk\Utilities\KWSys\vtksys\SystemTools.cxx:3296:30: note: suggested alternative: 'ERROR_BIDI_NOT_SUPPORTED'
return Status::Windows(ERROR_SYMLINK_NOT_SUPPORTED);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
ERROR_BIDI_NOT_SUPPORTED
mingw32-make.exe[2]: *** [Utilities\KWSys\vtksys\CMakeFiles\vtksys.dir\build.make:226: Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/SystemTools.cxx.obj] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:4241: Utilities/KWSys/vtksys/CMakeFiles/vtksys.dir/all] Error 2
mingw32-make.exe: *** [Makefile:135: all] Error 2
Since “windows.h” already includes “winerror.h”, it is not necessary to include “winerror.h” directly. E.g. see the wikipedia page.
You can check your “winerror.h” to make sure it contains this line (it almost certainly does):
#define ERROR_SYMLINK_NOT_SUPPORTED 1464
You can also check your compiler to make sure that it defines _WIN32. First, make an empty file “empty.c”, then run gcc like this:
gcc -E -dM empty.c
It should print a lot of things, including this:
#define _WIN32 1
Keep on investigating like this until you find out why ERROR_SYMLINK_NOT_SUPPORTED is not defined. I do not use mingw, so I can’t help you any more than this.
It looks like it has been there since MinGW 6.0.0 (Sep 2018) according to this blame. A -E -fdirectives-only dump of the preprocessor output when compiling this file would be handy. To get this, take the command line CMake runs, replace -o …/SystemTools.cxx.o with -E -fdirectives-only -o preproc.txt and share the preproc.txt file.