Trouble trying to build the latest version of VTK

Hello everyone,

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

Can you help me with this?

Hello,

Can you, please, check whether the offending file UserPath\vtk\Utilities\KWSys\vtksys\SystemTools.cxx includes winerror.h?

best,

PC

Hello Paulo,

No trace of winerror.h in that file !

Thank you for your reply,
Guilhem.

Please, try adding #include <winerror.h> to the source file in question, build and report the outcome.

I included :
MyPathmingw64/x86_64-w64-mingw32/include/winerror.h
MyPath/mingw64/x86_64-w64-mingw32/include/fltwinerror.h \

Nothing change…

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.

1 Like

It seems the MinGW’s winerror.h does not define ERROR_SYMLINK_NOT_SUPPORTED. I guess this may be something to report to the MinGW project.

Paulo, are you sure about that? Did you check?

Mine has it. I can’t say for the OP’s.

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.

Hi, Guilhem, did you solve this problem? If you fix it, then could you please tell me the solution?

@Takak11 @Guilhem

I checked and found that the definition of winerror in mingw which comes with Qt is missing, please open the file “Qt\Tools\mingw810_64\x86_64-w64-mingw32\include\winerror.h”, then search for “ERROR_INCORRECT_SIZE __ MSABI_LONG”, add the following definition below this field. MSABI_LONG”, and add the following definition to the bottom of this field.

#define ERROR_SYMLINK_CLASS_DISABLED                       1463
#define ERROR_SYMLINK_NOT_SUPPORTED                        1464
#define ERROR_XML_PARSE_ERROR                              1465
#define ERROR_XMLDSIG_ERROR                                1466
#define ERROR_RESTART_APPLICATION                          1467
#define ERROR_WRONG_COMPARTMENT                            1468
#define ERROR_AUTHIP_FAILURE                               1469
#define ERROR_NO_NVRAM_RESOURCES                           1470

Save the file and try to recompile