-
Notifications
You must be signed in to change notification settings - Fork 360
Open
Description
Hi.
I built Chipmunk from source using CMake + MSVC 2019.
Then, when using MSVC command line to link any program that uses cpHastySpace, I get the error
test.obj : error LNK2019: unresolved external symbol cpHastySpaceNew referenced in function main
test.exe : fatal error LNK1120: 1 unresolved externals
cpSpaceNew works, though.
Full CMD session to reproduce the issue:
c:\code\chipmunk2d>git rev-parse HEAD
1d01b2a40be3990f7b79f575b7ff35f3c62042e3
c:\code\chipmunk2d>git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
c:\code\chipmunk2d>cmake --version
cmake version 3.17.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
c:\code\chipmunk2d>cmake . -DBUILD_DEMOS=OFF
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version 10.0.18362.0 to target Windows 10.0.18363.
-- The C compiler identification is MSVC 19.25.28614.0
-- The CXX compiler identification is MSVC 19.25.28614.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.25.28610/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Configuring Chipmunk2D version 7.0.3
-- Configuring done
-- Generating done
-- Build files have been written to: C:/code/chipmunk2d
c:\code\chipmunk2d>cmake --build . --config Release
Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Checking Build System
Building Custom Rule C:/code/chipmunk2d/src/CMakeLists.txt
chipmunk.c
cpArbiter.c
cpArray.c
cpBBTree.c
cpBody.c
cpCollision.c
cpConstraint.c
cpDampedRotarySpring.c
cpDampedSpring.c
cpGearJoint.c
cpGrooveJoint.c
cpHashSet.c
cpHastySpace.c
cpMarch.c
cpPinJoint.c
cpPivotJoint.c
cpPolyShape.c
cpPolyline.c
C:\code\chipmunk2d\include\chipmunk/cpPolyline.h(9,17): warning C4200: nonstandard extension used: zero-sized array in
struct/union [C:\code\chipmunk2d\src\chipmunk.vcxproj]
C:\code\chipmunk2d\include\chipmunk/cpPolyline.h(9,17): message : This member will be ignored by a defaulted constructo
r or copy/move assignment operator [C:\code\chipmunk2d\src\chipmunk.vcxproj]
cpRatchetJoint.c
cpRobust.c
Generating Code...
Compiling...
cpRotaryLimitJoint.c
cpShape.c
cpSimpleMotor.c
cpSlideJoint.c
cpSpace.c
cpSpaceComponent.c
cpSpaceDebug.c
cpSpaceHash.c
cpSpaceQuery.c
cpSpaceStep.c
cpSpatialIndex.c
cpSweep1D.c
Generating Code...
Creating library C:/code/chipmunk2d/src/Release/chipmunk.lib and object C:/code/chipmunk2d/src/Release/chipmunk.ex
p
chipmunk.vcxproj -> C:\code\chipmunk2d\src\Release\chipmunk.dll
Building Custom Rule C:/code/chipmunk2d/src/CMakeLists.txt
chipmunk.c
cpArbiter.c
cpArray.c
cpBBTree.c
cpBody.c
cpCollision.c
cpConstraint.c
cpDampedRotarySpring.c
cpDampedSpring.c
cpGearJoint.c
cpGrooveJoint.c
cpHashSet.c
cpHastySpace.c
cpMarch.c
cpPinJoint.c
cpPivotJoint.c
cpPolyShape.c
cpPolyline.c
C:\code\chipmunk2d\include\chipmunk/cpPolyline.h(9,17): warning C4200: nonstandard extension used: zero-sized array in
struct/union [C:\code\chipmunk2d\src\chipmunk_static.vcxproj]
C:\code\chipmunk2d\include\chipmunk/cpPolyline.h(9,17): message : This member will be ignored by a defaulted constructo
r or copy/move assignment operator [C:\code\chipmunk2d\src\chipmunk_static.vcxproj]
cpRatchetJoint.c
cpRobust.c
Generating Code...
Compiling...
cpRotaryLimitJoint.c
cpShape.c
cpSimpleMotor.c
cpSlideJoint.c
cpSpace.c
cpSpaceComponent.c
cpSpaceDebug.c
cpSpaceHash.c
cpSpaceQuery.c
cpSpaceStep.c
cpSpatialIndex.c
cpSweep1D.c
Generating Code...
chipmunk_static.vcxproj -> C:\code\chipmunk2d\src\Release\chipmunk.lib
Building Custom Rule C:/code/chipmunk2d/CMakeLists.txt
c:\code\chipmunk2d>set INCLUDE=%INCLUDE%;c:\code\chipmunk2d\include
c:\code\chipmunk2d>set LIB=%LIB%;c:\code\chipmunk2d\src\Release
c:\code\chipmunk2d>type test.c
#include <chipmunk/chipmunk.h>
int main() {
cpHastySpaceNew();
return 0;
}
c:\code\chipmunk2d>cl /MD chipmunk.lib msvcrt.lib test.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.25.28614 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
test.c
Microsoft (R) Incremental Linker Version 14.25.28614.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
chipmunk.lib
msvcrt.lib
test.obj
test.obj : error LNK2019: unresolved external symbol cpHastySpaceNew referenced in function main
test.exe : fatal error LNK1120: 1 unresolved externals
Using cpSpaceNew instead works, though:
c:\code\chipmunk2d>type test.c
#include <chipmunk/chipmunk.h>
int main() {
cpSpaceNew();
return 0;
}
c:\code\chipmunk2d>cl /MD chipmunk.lib msvcrt.lib test.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.25.28614 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
test.c
Microsoft (R) Incremental Linker Version 14.25.28614.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:test.exe
chipmunk.lib
msvcrt.lib
test.obj
Creating library test.lib and object test.exp
Metadata
Metadata
Assignees
Labels
No labels