box2d icon indicating copy to clipboard operation
box2d copied to clipboard

Box2d failed to build with "error C3861: '__rdtsc': identifier not found" on Windows arm64 with MSVC

Open KarenHuang2016 opened this issue 2 months ago • 1 comments

The MSVC team regularly builds popular open-source projects, including yours, with development versions of the build tools in order to find and fix regressions in the compiler and libraries before they can ship and cause trouble for the world. This also allows us to provide advance notice of breaking changes, which is the case here.

Box2d failed to build with "error C3861: '__rdtsc': identifier not found" on Windows arm64 with MSVC. Could you please help to take a look at this? Thanks in advance!

Repro steps:

  1. Open VS2022 x64 CMD
  2. "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsamd64_arm64.bat"
  3. git clone https://github.com/erincatto/box2d C:\gitP\erincatto\box2d
  4. cd /d C:\gitP\erincatto\box2d
  5. mkdir build_arm64 && cd build_arm64
  6. set CL=/wd4098
  7. cmake -G "Visual Studio 17 2022" -A arm64 -DCMAKE_SYSTEM_VERSION=10.0.26100.0 ..
  8. msbuild /m /p:Platform=arm64 /p:Configuration=Release box2d.sln /t:Rebuild

Error info: C:\gitP\erincatto\box2d\samples\sample_benchmark.cpp(1736,27): error C3861: '__rdtsc': identifier not found [C:\gitP\erincatto\box2d\build_arm64\samples\samples.vcxproj] C:\gitP\erincatto\box2d\samples\sample_benchmark.cpp(1745,25): error C3861: '__rdtsc': identifier not found [C:\gitP\erincatto\box2d\build_arm64\samples\samples.vcxproj]

Test log file: Build (35).log

KarenHuang2016 avatar Nov 06 '25 06:11 KarenHuang2016

I never tried to build MSVC for Arm. Unfortunately I don't have access to hardware capable of testing it.

erincatto avatar Nov 07 '25 07:11 erincatto

Closing this due to lack of reply.

erincatto avatar Dec 14 '25 23:12 erincatto