Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Box2d failed to build with error LNK2019 and error C3861: 'aligned_alloc': identifier not found on windows with MSVC target X86 #809

Closed
spacelg opened this issue Sep 29, 2024 · 2 comments

Comments

@spacelg
Copy link

spacelg commented Sep 29, 2024

Hi,

Box2d failed to build with error LNK2019: unresolved external symbol _aligned_alloc referenced in function _b2Alloc and error C3861: 'aligned_alloc': identifier not found on windows with MSVC target X86, it can be reproduced on latest version df7373c on main branch. Are builds targeting X86 no longer supported? Could you please help look at this issue? Thanks in advance.

Note: it can build pass on target X64.

Steps to reproduce the behavior:

  1. git clone https://github.com/erincatto/box2d C:\gitP\erincatto\box2d
  2. Open a VS2022 x86 cmd
  3. cd C:\gitP\erincatto\box2d && mkdir build_x86 && cd C:\gitP\erincatto\box2d\build_x86
  4. set CL=/wd4047
  5. cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 ..
  6. msbuild /m /p:Platform=Win32 /p:Configuration=Release box2d.sln /t:Rebuild

Error Log:
Build.log

ErrorMessage:
8>box2d.lib(core.obj) : error LNK2019: unresolved external symbol _aligned_alloc referenced in function _b2Alloc [C:\gitP\erincatto\box2d\build_x86\test\test.vcxproj]
...
C:\gitP\erincatto\box2d\samples\main.cpp(74,14): error C3861: 'aligned_alloc': identifier not found [C:\gitP\erincatto\box2d\build_x86\samples\samples.vcxproj]

@erincatto
Copy link
Owner

I have not added support for 32-bit. What is the use case for 32-bit?

erincatto added a commit that referenced this issue Oct 6, 2024
- optimized ray and shape cast : 2x faster
- update mass options instead of automatic mass
- fixes for 32-bit Windows build
- b2TreeStats for measuring query performance
- reduced tree node size from 48-bytes to 40-bytes
- fixes for 32-bit Neon
- MSVC warning level 4 and fixes
#814, #815, #813, #809
@erincatto
Copy link
Owner

I made some 32-bit fixes in #817. Win32 should build and run now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants