anura-engine / anura

Anura Engine
Other
384 stars 78 forks source link

Compilation on Windows on ARM64 Fails Due to Dependency #349

Open k8wu opened 1 year ago

k8wu commented 1 year ago

I have a Surface Pro X running the latest version of Windows 11 (22H2). The Surface Pro X has a Microsoft SQ2 processor (more or less a rebadged Qualcomm Snapdragon 8cx), and while it will run Intel/AMD (x86/x64) binaries, I'd prefer to have a native ARM64 version so that it's faster and doesn't have to push everything through the virtualization layer.

There is a Visual Studio solution file for Anura, so I opened that in Visual Studio 2022 (17.4.3), added ARM64 as a platform to the solution file using the Configuration Manager (copying settings from Win32), and built the project. I do have vcpkg integrated, so it uses that to pull in any dependencies that are needed.

Unfortunately, it bombed when trying to compile pthreads. The reason for this is because it depends on some symbol that isn't available on this platform. Here is the content from the output file that was generated when this error was encountered:

        "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostarm64\arm64\nmake.exe" /E clean VC-static
        if exist *.obj del *.obj
        if exist *.def del *.def
        if exist *.ilk del *.ilk
        if exist *.pdb del *.pdb
        if exist *.exp del *.exp
        if exist *.map del *.map
        if exist *.o del *.o
        if exist *.i del *.i
        if exist *.res del *.res
        if exist *_stamp del *_stamp
        cd tests && "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostarm64\arm64\nmake.exe" clean
        if exist *.dll erase *.dll
        if exist *.lib erase *.lib
        if exist _ptw32.h erase _ptw32.h
        if exist pthread.h erase pthread.h
        if exist semaphore.h erase semaphore.h
        if exist sched.h erase sched.h
        if exist *.e erase *.e
        if exist *.i erase *.i
        if exist *.obj erase *.obj
        if exist *.pdb erase *.pdb
        if exist *.o erase *.o
        if exist *.asm erase *.asm
        if exist *.exe erase *.exe
        if exist *.manifest erase *.manifest
        if exist *.pass erase *.pass
        if exist *.bench erase *.bench
        cl /errorReport:none /nologo /MD /I. /DHAVE_CONFIG_H /W3 /O2 /Ob2  /D__PTW32_STATIC_LIB /D__PTW32_BUILD_INLINED /D__PTW32_CLEANUP_C /Fopthread.o -c pthread.c
pthread.c
        rc /d__PTW32_ARCHARM64 /d__PTW32_RC_MSC /d__PTW32_CLEANUP_C version.rc
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384

Copyright (C) Microsoft Corporation.  All rights reserved.

version.rc(132) : error RC2104 : undefined keyword or key name: __PTW32_VERSIONINFO_DESCRIPTION

Here is the error file:

Microsoft (R) Program Maintenance Utility Version 14.34.31937.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) Program Maintenance Utility Version 14.34.31937.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Microsoft (R) Program Maintenance Utility Version 14.34.31937.0
Copyright (C) Microsoft Corporation.  All rights reserved.

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\\arm64\rc.EXE"' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostarm64\arm64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostarm64\arm64\nmake.exe"' : return code '0x2'
Stop.