cocos2d/cocos2d-x

undefined reference to libchipmunk.a

marklove5102 opened this issue · 3 comments

  • cocos2d-x version:git 2023-01-16
  • devices test on:
  • developing environments
    • NDK version:
    • Xcode version:
    • VS version:
    • browser type and version:

Steps to Reproduce:

  1. archlinux
[make@archlinux linux-build]$ make -j4
[  0%] Built target ext_xxhash
[  1%] Built target ext_tinyxml2
[  3%] Built target ext_unzip
[  4%] Built target ext_recast
[  4%] Built target ext_xxtea
[  4%] Built target ext_edtaa3func
[  5%] Built target ext_clipper
[  5%] Built target ext_convertUTF
[  5%] Built target ext_poly2tri
[  6%] Built target ext_md5
[  6%] Built target ext_tolua
Copying resources for cpp-empty-test ...
Copying resources for cpp-tests ...
    copying to /home/make/Desktop/cocos2d-x/build/linux-build/bin/cpp-empty-test/Resources
    copying to /home/make/Desktop/cocos2d-x/build/linux-build/bin/cpp-tests/Resources
Copying lua scripts ...
[  8%] Built target ext_luasocket
Copying resources for lua-empty-test ...
    copying to /home/make/Desktop/cocos2d-x/build/linux-build/bin/lua-empty-test/Resources/res
[  8%] Built target SYNC_RESOURCE-cpp-empty-test
[  8%] Built target COPY_LUA-lua-empty-test
[  8%] Built target SYNC_RESOURCE-lua-empty-test
[  8%] Built target SYNC_RESOURCE-cpp-tests
Copying lua scripts ...
Copying resources for lua-tests ...
Copying resources for HelloCpp ...
[  9%] Built target external
    copying to /home/make/Desktop/cocos2d-x/build/linux-build/bin/lua-tests/Resources/res
    copying to /home/make/Desktop/cocos2d-x/build/linux-build/bin/HelloCpp/Resources
    copying to /home/make/Desktop/cocos2d-x/build/linux-build/bin/lua-tests/Resources/res
[  9%] Built target SYNC_RESOURCE-HelloCpp
[  9%] Built target COPY_LUA-lua-tests
[  9%] Built target SYNC_RESOURCE-lua-tests
[ 78%] Built target cocos2d
[ 78%] Linking CXX executable ../../../bin/HelloCpp/HelloCpp
[ 79%] Linking CXX executable ../../../bin/cpp-empty-test/cpp-empty-test
[ 79%] Linking CXX executable ../../../bin/cpp-tests/cpp-tests
[ 86%] Built target luacocos2d
[ 86%] Building CXX object engine/tests/lua-empty-test/CMakeFiles/lua-empty-test.dir/Classes/AppDelegate.cpp.o
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpGearJoint.c.o): in function `preStep':
cpGearJoint.c:(.text+0x144): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpDampedSpring.c.o): in function `preStep':
cpDampedSpring.c:(.text+0x1fd): undefined reference to `__expf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpRotaryLimitJoint.c.o): in function `preStep':
cpRotaryLimitJoint.c:(.text+0x17d): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpDampedRotarySpring.c.o): in function `preStep':
cpDampedRotarySpring.c:(.text+0xf2): undefined reference to `__expf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpGrooveJoint.c.o): in function `preStep':
cpGrooveJoint.c:(.text+0x327): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpSlideJoint.c.o): in function `preStep':
cpSlideJoint.c:(.text+0x42b): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpPivotJoint.c.o): in function `preStep':
cpPivotJoint.c:(.text+0x1e8): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpRatchetJoint.c.o): in function `preStep':
cpRatchetJoint.c:(.text+0x16a): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpPinJoint.c.o): in function `preStep':
cpPinJoint.c:(.text+0x324): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpHastySpace.c.o):cpHastySpace.c:(.text+0x560): more undefined references to `__powf_finite' follow
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpGearJoint.c.o): in function `preStep':
cpGearJoint.c:(.text+0x144): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpDampedSpring.c.o): in function `preStep':
cpDampedSpring.c:(.text+0x1fd): undefined reference to `__expf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpRotaryLimitJoint.c.o): in function `preStep':
cpRotaryLimitJoint.c:(.text+0x17d): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpDampedRotarySpring.c.o): in function `preStep':
cpDampedRotarySpring.c:(.text+0xf2): undefined reference to `__expf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpGrooveJoint.c.o): in function `preStep':
cpGrooveJoint.c:(.text+0x327): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpSlideJoint.c.o): in function `preStep':
cpSlideJoint.c:(.text+0x42b): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpPivotJoint.c.o): in function `preStep':
cpPivotJoint.c:(.text+0x1e8): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpRatchetJoint.c.o): in function `preStep':
cpRatchetJoint.c:(.text+0x16a): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpPinJoint.c.o): in function `preStep':
cpPinJoint.c:(.text+0x324): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpHastySpace.c.o):cpHastySpace.c:(.text+0x560): more undefined references to `__powf_finite' follow
collect2: 错误:ld 返回 1
make[2]: *** [engine/tests/HelloCpp/CMakeFiles/HelloCpp.dir/build.make:167: bin/HelloCpp/HelloCpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:1418: engine/tests/HelloCpp/CMakeFiles/HelloCpp.dir/all] Error 2
make[1]: *** 正在等待未完成的任务....
[ 86%] Building CXX object engine/tests/lua-empty-test/CMakeFiles/lua-empty-test.dir/proj.linux/main.cpp.o
collect2: 错误:ld 返回 1
make[2]: *** [engine/tests/cpp-empty-test/CMakeFiles/cpp-empty-test.dir/build.make:167: bin/cpp-empty-test/cpp-empty-test] Error 1
make[1]: *** [CMakeFiles/Makefile2:1102: engine/tests/cpp-empty-test/CMakeFiles/cpp-empty-test.dir/all] Error 2
[ 86%] Linking CXX executable ../../../bin/lua-empty-test/lua-empty-test
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpGearJoint.c.o): in function `preStep':
cpGearJoint.c:(.text+0x144): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpDampedSpring.c.o): in function `preStep':
cpDampedSpring.c:(.text+0x1fd): undefined reference to `__expf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpRotaryLimitJoint.c.o): in function `preStep':
cpRotaryLimitJoint.c:(.text+0x17d): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpDampedRotarySpring.c.o): in function `preStep':
cpDampedRotarySpring.c:(.text+0xf2): undefined reference to `__expf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpGrooveJoint.c.o): in function `preStep':
cpGrooveJoint.c:(.text+0x327): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpSlideJoint.c.o): in function `preStep':
cpSlideJoint.c:(.text+0x42b): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpPivotJoint.c.o): in function `preStep':
cpPivotJoint.c:(.text+0x1e8): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpRatchetJoint.c.o): in function `preStep':
cpRatchetJoint.c:(.text+0x16a): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpPinJoint.c.o): in function `preStep':
cpPinJoint.c:(.text+0x324): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpHastySpace.c.o):cpHastySpace.c:(.text+0x560): more undefined references to `__powf_finite' follow
collect2: 错误:ld 返回 1
make[2]: *** [engine/tests/cpp-tests/CMakeFiles/cpp-tests.dir/build.make:2349: bin/cpp-tests/cpp-tests] Error 1
make[1]: *** [CMakeFiles/Makefile2:1166: engine/tests/cpp-tests/CMakeFiles/cpp-tests.dir/all] Error 2
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpGearJoint.c.o): in function `preStep':
cpGearJoint.c:(.text+0x144): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpDampedSpring.c.o): in function `preStep':
cpDampedSpring.c:(.text+0x1fd): undefined reference to `__expf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpRotaryLimitJoint.c.o): in function `preStep':
cpRotaryLimitJoint.c:(.text+0x17d): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpDampedRotarySpring.c.o): in function `preStep':
cpDampedRotarySpring.c:(.text+0xf2): undefined reference to `__expf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpGrooveJoint.c.o): in function `preStep':
cpGrooveJoint.c:(.text+0x327): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpSlideJoint.c.o): in function `preStep':
cpSlideJoint.c:(.text+0x42b): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpPivotJoint.c.o): in function `preStep':
cpPivotJoint.c:(.text+0x1e8): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpRatchetJoint.c.o): in function `preStep':
cpRatchetJoint.c:(.text+0x16a): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpPinJoint.c.o): in function `preStep':
cpPinJoint.c:(.text+0x324): undefined reference to `__powf_finite'
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a(cpHastySpace.c.o):cpHastySpace.c:(.text+0x560): more undefined references to `__powf_finite' follow
collect2: 错误:ld 返回 1
make[2]: *** [engine/tests/lua-empty-test/CMakeFiles/lua-empty-test.dir/build.make:155: bin/lua-empty-test/lua-empty-test] Error 1
make[1]: *** [CMakeFiles/Makefile2:1234: engine/tests/lua-empty-test/CMakeFiles/lua-empty-test.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

gcc -v

使用内建 specs。
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/12.2.0/lto-wrapper
目标:x86_64-pc-linux-gnu
配置为:/build/gcc/src/gcc/configure --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --with-build-config=bootstrap-lto --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-libstdcxx-backtrace --enable-link-serialization=1 --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-werror
线程模型:posix
Supported LTO compression algorithms: zlib zstd
gcc 版本 12.2.0 (GCC) 

include !!!!

/cocos2d-x/cocos/renderer/CCMeshCommand.cpp:42:10: 致命错误:xxhash.h:没有那个文件或目录
   42 | #include "xxhash.h"
/cocos2d-x/cocos/renderer/CCPass.cpp:31:10: 致命错误:xxhash.h:没有那个文件或目录
   31 | #include <xxhash.h>

include <> >> ""

[ 86%] Linking CXX executable ../../../bin/cpp-empty-test/cpp-empty-test
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/make/Desktop/cocos2d-x/external/linux-specific/fmod/prebuilt/64-bit/libfmod.so: .dynsym local symbol at index 4 (>= sh_info of 2)
/usr/bin/ld: ../../../lib/libcocos2d.a(CCPhysicsWorld.cpp.o): in function `cocos2d::PhysicsWorld::init()':
CCPhysicsWorld.cpp:(.text+0x1d7f): undefined reference to `cpHastySpaceNew()'
/usr/bin/ld: CCPhysicsWorld.cpp:(.text+0x1d9c): undefined reference to `cpHastySpaceSetThreads(cpSpace*, unsigned long)'
/usr/bin/ld: ../../../lib/libcocos2d.a(CCPhysicsWorld.cpp.o): in function `cocos2d::PhysicsWorld::update(float, bool)':
CCPhysicsWorld.cpp:(.text+0x35fd): undefined reference to `cpHastySpaceStep(cpSpace*, double)'
/usr/bin/ld: CCPhysicsWorld.cpp:(.text+0x36c5): undefined reference to `cpHastySpaceStep(cpSpace*, double)'
/usr/bin/ld: CCPhysicsWorld.cpp:(.text+0x3789): undefined reference to `cpHastySpaceStep(cpSpace*, double)'
/usr/bin/ld: ../../../lib/libcocos2d.a(CCPhysicsWorld.cpp.o): in function `cocos2d::PhysicsWorld::~PhysicsWorld()':
CCPhysicsWorld.cpp:(.text+0x3be0): undefined reference to `cpHastySpaceFree(cpSpace*)'
collect2: 错误:ld 返回 1
make[2]: *** [engine/tests/cpp-empty-test/CMakeFiles/cpp-empty-test.dir/build.make:167: bin/cpp-empty-test/cpp-empty-test] Error 1
make[1]: *** [CMakeFiles/Makefile2:1102: engine/tests/cpp-empty-test/CMakeFiles/cpp-empty-test.dir/all] Error 2
make: *** [Makefile:91: all] Error 2