forgottenserver
forgottenserver copied to clipboard
Forgottenserver failed to build with error C2278 on Windows with option /std:c++latest
Before creating an issue, please ensure:
- [X] This is a bug in the software that resides in this repository, and not a support matter (use https://otland.net/forums/support.16/ for support)
- [X] This issue is reproducible without changes to the C++ code in this repository
Hi, recently, the MSVC team updated the commit of Forgottenserver and vcpkg for RWC testing, and it build failed due to the F:\gitP\otland\forgottenserver\src\tools.h(77,25): error C2278: 'constant': unexpected token. Format is '__has_cpp_attribute( identifier )'
. Could you please look this issue? Thanks.
Steps to reproduce (include any configuration/script required to reproduce)
- git clone https://github.com/otland/forgottenserver F:\gitP\otland\forgottenserver
- git clone https://github.com/Microsoft/vcpkg F:\gitP\Microsoft\vcpkg
- git -C "F:\gitP\Microsoft\vcpkg" reset --hard d99b693
- git -C "F:\gitP\otland\forgottenserver" reset --hard 419124f
- set CL= /std:c++latest
- cd F:\gitP\Microsoft\vcpkg
- bootstrap-vcpkg.bat
- vcpkg.exe install --recurse boost-iostreams boost-asio boost-system boost-filesystem boost-variant boost-lockfree luajit libmariadb pugixml cryptopp fmt --triplet x64-windows --clean-after-build
- mkdir F:\gitP\otland\forgottenserver\build_amd64 & cd F:\gitP\otland\forgottenserver\build_amd64
- cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DCMAKE_BUILD_TYPE=Release -DMARIADB_LIBRARIES=F:/gitP/microsoft/vcpkg/installed/x64-windows/lib/libmariadb.lib -DCMAKE_TOOLCHAIN_FILE=F:\gitP\Microsoft\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows ..
- msbuild /m /p:Platform=x64 /p:Configuration=Release /p:PlatformToolset=v143 tfs.sln /t:Rebuild (or msbuild /m /p:Platform=x64 /p:Configuration=Release /p:PlatformToolset=v143 vc17/theforgottenserver.vcxproj /t:Rebuild)
Expected behaviour
Build sucessfully.
Actual behaviour
F:\gitP\otland\forgottenserver\src\tools.h(77,25): error C2278: 'constant': unexpected token. Format is '__has_cpp_attribute( identifier )' [F:\gitP\otland\forgottenserver\build_amd64\src\tfslib.vcxproj]
Environment
Windows Server 2022
Reproduction environment
VS2022
build log: build.log