cocos2d-x icon indicating copy to clipboard operation
cocos2d-x copied to clipboard

cocos2d-x-4 linking error when integrating with libchipmunk on linux,How to compile libchipmunk source code?

Open Sickyour opened this issue 3 years ago • 1 comments

  • cocos2d-x version: cocos2d-x-4
  • devices test on: ubuntu20.04
  • developing environments
    • NDK version
    • Xcode version:
    • VS version:
    • browser type and version:

Steps to Reproduce:

  1. cd cocos-2d-x-root/
  2. mkdir -p build/linux-build
  3. make ../..
  4. make -j 4 error : linking error when integrating with libchipmunk.a

I want to cross-compile the libchipmunk source code, Specific steps? I would like to compile libchiomunk for specific steps? Thanks you !

Sickyour avatar Nov 16 '22 11:11 Sickyour

Development environment system : ubuntu20.04 Dependent tools: gcc-9-aarch64-linux-gnu, g++-9-aarch64-linux-gnu [ 86%] Built target luacocos2d [ 86%] Linking CXX executable ../../../bin/lua-empty-test/lua-empty-test /usr/bin/ld: ../../../../../external/freetype2/prebuilt/linux/64-bit/libfreetype.a(ftinit.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: ../../../../../external/freetype2/prebuilt/linux/64-bit/libfreetype.a(ftinit.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: ../../../../../external/freetype2/prebuilt/linux/64-bit/libfreetype.a(ftinit.o): Relocations in generic ELF (EM: 62) /usr/bin/ld: ../../../../../external/freetype2/prebuilt/linux/64-bit/libfreetype.a: error adding symbols: file in wrong format collect2: error: ld returned 1 exit status make[2]: *** [engine/tests/cpp-empty-test/CMakeFiles/cpp-empty-test.dir/build.make:152: bin/cpp-empty-test/cpp-empty-test] Error 1 make[1]: *** [CMakeFiles/Makefile2:1233: engine/tests/cpp-empty-test/CMakeFiles/cpp-empty-test.dir/all] Error 2

The questions are as follows:

  1. I compiled the libchipmunk 7.0.0 library, which solved the above problem.
  2. I want to use cross-compiled cocos2d-x-4, how can I modify the CMakeLists.txt file?

Sickyour avatar Nov 17 '22 09:11 Sickyour