forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Forgottenserver failed to build with error C2278 on Windows with option /std:c++latest

Open Zhaojun-Liu opened this issue 1 year ago • 0 comments

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)

  1. git clone https://github.com/otland/forgottenserver F:\gitP\otland\forgottenserver
  2. git clone https://github.com/Microsoft/vcpkg F:\gitP\Microsoft\vcpkg
  3. git -C "F:\gitP\Microsoft\vcpkg" reset --hard d99b693
  4. git -C "F:\gitP\otland\forgottenserver" reset --hard 419124f
  5. set CL= /std:c++latest
  6. cd F:\gitP\Microsoft\vcpkg
  7. bootstrap-vcpkg.bat
  8. 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
  9. mkdir F:\gitP\otland\forgottenserver\build_amd64 & cd F:\gitP\otland\forgottenserver\build_amd64
  10. 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 ..
  11. 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

Zhaojun-Liu avatar Oct 16 '23 06:10 Zhaojun-Liu