kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
781 stars 240 forks source link

Linker Command Failure Error While Building Python3 #905

Closed rahulkumaratphilips closed 1 month ago

rahulkumaratphilips commented 7 months ago

Followed the steps from readme description to build python3, but it failed and the terminal stream is as follows - `[DEBUG ] ld: warning: -undefined dynamic_lookup is deprecated on iOS-simulator [DEBUG ] ld: warning: -undefined dynamic_lookup is deprecated on iOS-simulator [DEBUG ] ld: warning: -undefined dynamic_lookup is deprecated on iOS-simulator [DEBUG ] ld: warning: -undefined dynamic_lookup is deprecated on iOS-simulator [DEBUG ] ld: warning: ignoring duplicate libraries: '-lm', '-lssl', '-lz' [DEBUG ] ld: warning: ignoring duplicate libraries: '-lm', '-lssl', '-lz' [DEBUG ] ld: warning: search path './../Support/BZip2' not found [DEBUG ] ld: warning: search path './../Support/BZip2' not found [DEBUG ] ld: building for 'iOS-simulator', but linking in dylib (/usr/local/Cellar/libb2/0.98.1/lib/libb2.1.dylib) built for 'macOS' [DEBUG ] ld: building for 'iOS-simulator', but linking in dylib (/usr/local/Cellar/libb2/0.98.1/lib/libb2.1.dylib) built for 'macOS' [DEBUG ] clang: error: linker command failed with exit code 1 (use -v to see invocation) [DEBUG ] clang: error: linker command failed with exit code 1 (use -v to see invocation) [DEBUG ] make: [python.exe] Error 1 [DEBUG ] make: Waiting for unfinished jobs.... [DEBUG ] make: [Programs/_testembed] Error 1 Exception in thread background thread for pid 56968: Traceback (most recent call last): File "/Users/rahulkumar/.pyenv/versions/3.10.6/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/Users/rahulkumar/.pyenv/versions/3.10.6/lib/python3.10/threading.py", line 953, in run self._target(self._args, self._kwargs) File "/Users/rahulkumar/Desktop/Python_Interpreter/kivy-ios/venv/lib/python3.10/site-packages/sh.py", line 1639, in wrap fn(*rgs, **kwargs) File "/Users/rahulkumar/Desktop/Python_Interpreter/kivy-ios/venv/lib/python3.10/site-packages/sh.py", line 2641, in background_thread handle_exit_code(exit_code) File "/Users/rahulkumar/Desktop/Python_Interpreter/kivy-ios/venv/lib/python3.10/site-packages/sh.py", line 2332, in fn return self.command.handle_command_exit_code(exit_code) File "/Users/rahulkumar/Desktop/Python_Interpreter/kivy-ios/venv/lib/python3.10/site-packages/sh.py", line 826, in handle_command_exit_code raise exc sh.ErrorReturnCode_2:

RAN: /usr/bin/make -j12 'CFLAGS=-O3 -miphonesimulator-version-min=9.0 -I/Users/rahulkumar/Desktop/Python_Interpreter/kivy-ios/dist/include/iphonesimulator-x86_64/ffi -I/Users/rahulkumar/Desktop/Python_Interpreter/kivy-ios/dist/include/iphonesimulator-x86_64/openssl -I/Users/rahulkumar/Desktop/Python_Interpreter/kivy-ios/dist/include/common/numpy -I/Users/rahulkumar/Desktop/Python_Interpreter/kivy-ios/dist/include/iphonesimulator-x86_64 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.4.sdk'`

Think the error is - linker command failed with exit code 1 (use -v to see invocation)

Please let me know if some changes needs to be done in configurations before running the build commands.

tcaduser commented 7 months ago

I am able to build on my system, comparing my errors warnings to yours:

[DEBUG ] ld: warning: search path './../Support/BZip2' not found
[DEBUG ] ld: building for 'iOS-simulator', but linking in dylib (/usr/local/Cellar/libb2/0.98.1/lib/libb2.1.dylib) built for 'macOS'

I am getting the first line, but not the second. In addition, my build log has:

21775 [DEBUG   ] checking for LIBB2... no

It looks like this library is not even needed. Maybe you can try uninstalling libb2 from homebrew because it may be confusing the build:

brew uninstall libb2

and try and rebuild?