minetest failed to build with error C2589, error C3878, error C2760 with MSVC under /permissive- mode on Windows
Zhaojun-Liu opened this issue · comments
June Liu commented
Minetest version
commit is 7ffc0268dfd78647187554d6248015329e9f5d2d
OS / Hardware
Operating system: Windows server 2019
CPU:
GPU model:
OpenGL version:
Summary
Minetest failed to build with error C2589, error C3878, error C2760 with MSVC under /permissive- mode on Windows. The commit we use is 7ffc0268dfd78647187554d6248015329e9f5d2d. Could you please take a look? Thanks.
VS version: VS2019 (16.11.11)
OS: Windwos server 2019
Steps to reproduce
- git clone https://github.com/minetest/minetest F:\gitP\minetest\minetest and cd F:\gitP\minetest\minetest
- xcopy F:\gitP\minetest\irrlicht F:\gitP\minetest\minetest\lib\irrlichtmt /k/r/e/i/s/c/h/f/y
- cd F:\gitP\Microsoft\vcpkg and bootstrap-vcpkg.bat 2>&1
- vcpkg.exe install --recurse zlib zstd curl[winssl] openal-soft libvorbis libogg sqlite3 freetype luajit gmp jsoncpp libjpeg-turbo --triplet x64-windows --clean-after-build 2>&1
- mkdir F:\gitP\minetest\minetest\build_amd64 and cd F:\gitP\minetest\minetest\build_amd64
- cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_BUILD_TYPE=Release -DENABLE_GETTEXT=OFF -DENABLE_CURSES=OFF -DCMAKE_TOOLCHAIN_FILE=F:\gitP\Microsoft\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows .. 2>&1
- set CL= /permissive-
- mkdir F:\gitP\minetest\minetest\sdklocaltools and cd F:\gitP\minetest\minetest\sdklocaltools
- set PATH=F:\tools\build2\bin;%PATH%
- curl https://www.khronos.org/registry/OpenGL/api/GL/glext.h -O -L 2>&1
curl https://www.khronos.org/registry/OpenGL/api/GL/glcorearb.h -O -L 2>&1
curl https://www.khronos.org/registry/OpenGL/api/GL/glxext.h -O -L 2>&1
curl https://www.khronos.org/registry/OpenGL/api/GL/wglext.h -O -L 2>&1 - xcopy F:\gitP\minetest\minetest\sdklocaltools "C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\gl" /k/r/e/i/s/c/h/f/y
- cd F:\gitP\minetest\minetest\build_amd64
- msbuild /m /p:Platform=x64 /p:Configuration=Release minetest.sln /t:Rebuild 2>&1
Excepted result:
build successfully.
Actual result:
F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C2589: '(': illegal token on right side of '::' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C3878: syntax error: unexpected token '(' following 'expression' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C2760: syntax error: ')' was unexpected here; expected ';' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C3878: syntax error: unexpected token ')' following 'expression_statement' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C2760: syntax error: ':' was unexpected here; expected ';' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
F:\gitP\minetest\minetest\lib\irrlichtmt\include\irrArray.h(397,16): error C3878: syntax error: unexpected token ':' following 'expression_statement' [F:\gitP\minetest\minetest\build_amd64\lib\irrlichtmt\source\Irrlicht\IRROTHEROBJ.vcxproj]
Detailed log:
sfan5 commented
We have Visual Studio builds in our CI and they run fine.
Does removing /permissive-
from the flags make a difference?
It looks like VS has a problem with std::min
here, replacing this with core::min_
might also help.