【问题标题】:Kivy Mac throwing undefined symbols for x86 architectureKivy Mac 为 x86 架构抛出未定义的符号
【发布时间】:2020-02-12 19:53:53
【问题描述】:

我正在尝试让我的 kivy 应用程序在 IOS 上运行。我已经为 kivy-ios 克隆了 git repo,并在选择食谱时尝试了 toolchain.py run 命令的多种组合 我被困在 python 3 上,因为我无法使用 python 2,因为它已被弃用并且缺少库(md5) 我使用命令 python3 toolchain.py build python3 kivy。 构建成功,直到它进入构建的 python3 部分(我尝试切换到构建 python2,但它不起作用)。然后它在链接时抛出有关架构的错误

我已经尝试过新克隆 kivy-ios 不同的命令变体,我尝试通过自制软件安装 libffi,但仍然无法正常工作。提前感谢您的任何帮助

全部打印出来

[DEBUG   ] ld: warning: ld: warning: directory not found for option '-L/Users/myname/Desktop/KiloGram/kivy-ios/dist/hostlibffi/usr/local/lib'directory not found for option '-L/Users/myname/Desktop/KiloGram/kivy-ios/dist/hostlibffi/usr/local/lib'
[DEBUG   ] 
[DEBUG   ] ld: warning: ld: warning: directory not found for option '-L/Users/myname/Desktop/KiloGram/kivy-ios/dist/hostlibffi/usr/local/lib'directory not found for option '-L/Users/myname/Desktop/KiloGram/kivy-ios/dist/hostlibffi/usr/local/lib'
[DEBUG   ] 
[DEBUG   ] ld: warning: ld: warning: ignoring file libpython3.7m.a, file was built for archive which is not the architecture being linked (x86_64): libpython3.7m.aignoring file libpython3.7m.a, file was built for archive which is not the architecture being linked (x86_64): libpython3.7m.a
[DEBUG   ] 
[DEBUG   ] Undefined symbols for architecture x86_64:
[DEBUG   ]   "__Py_UnixMain", referenced from:
[DEBUG   ]       _main in python.o
[DEBUG   ] ld: symbol(s) not found for architecture x86_64
[DEBUG   ] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[DEBUG   ] Undefined symbols for architecture x86_64:
[DEBUG   ]   "_PyEval_InitThreads", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]   "_PyEval_ReleaseThread", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]   "_PyEval_RestoreThread", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]       _test_bpo20891 in _testembed.o
[DEBUG   ]   "_PyEval_SaveThread", referenced from:
[DEBUG   ]       _test_bpo20891 in _testembed.o
[DEBUG   ]   "_PyGILState_Check", referenced from:
[DEBUG   ]       _bpo20891_thread in _testembed.o
[DEBUG   ]   "_PyGILState_Ensure", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]       _bpo20891_thread in _testembed.o
[DEBUG   ]   "_PyGILState_Release", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]       _bpo20891_thread in _testembed.o
[DEBUG   ]   "_PyInterpreterState_GetID", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]   "_PyMem_RawFree", referenced from:
[DEBUG   ]       _test_pre_initialization_api in _testembed.o
[DEBUG   ]   "_PyRun_SimpleStringFlags", referenced from:
[DEBUG   ]       _test_forced_io_encoding in _testembed.o
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]       _test_pre_initialization_api in _testembed.o
[DEBUG   ]       _test_pre_initialization_sys_options in _testembed.o
[DEBUG   ]   "_PySys_AddWarnOption", referenced from:
[DEBUG   ]       _test_pre_initialization_sys_options in _testembed.o
[DEBUG   ]   "_PySys_AddXOption", referenced from:
[DEBUG   ]       _test_pre_initialization_sys_options in _testembed.o
[DEBUG   ]   "_PySys_ResetWarnOptions", referenced from:
[DEBUG   ]       _test_pre_initialization_sys_options in _testembed.o
[DEBUG   ]   "_PyThreadState_Get", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_PyThreadState_Swap", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]   "_PyThread_acquire_lock", referenced from:
[DEBUG   ]       _test_bpo20891 in _testembed.o
[DEBUG   ]   "_PyThread_allocate_lock", referenced from:
[DEBUG   ]       _test_bpo20891 in _testembed.o
[DEBUG   ]   "_PyThread_exit_thread", referenced from:
[DEBUG   ]       _bpo20891_thread in _testembed.o
[DEBUG   ]   "_PyThread_free_lock", referenced from:
[DEBUG   ]       _test_bpo20891 in _testembed.o
[DEBUG   ]   "_PyThread_release_lock", referenced from:
[DEBUG   ]       _bpo20891_thread in _testembed.o
[DEBUG   ]   "_PyThread_start_new_thread", referenced from:
[DEBUG   ]       _test_bpo20891 in _testembed.o
[DEBUG   ]   "_Py_BytesWarningFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_DebugFlag", referenced from:
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_DecodeLocale", referenced from:
[DEBUG   ]       _test_pre_initialization_api in _testembed.o
[DEBUG   ]   "_Py_DontWriteBytecodeFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_EndInterpreter", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]   "_Py_Finalize", referenced from:
[DEBUG   ]       _test_forced_io_encoding in _testembed.o
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]       _test_pre_initialization_api in _testembed.o
[DEBUG   ]       _test_pre_initialization_sys_options in _testembed.o
[DEBUG   ]       _test_initialize_twice in _testembed.o
[DEBUG   ]       _test_initialize_pymain in _testembed.o
[DEBUG   ]       _test_init_default_config in _testembed.o
[DEBUG   ]       ...
[DEBUG   ]   "_Py_FrozenFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_GetProgramName", referenced from:
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_IgnoreEnvironmentFlag", referenced from:
[DEBUG   ]       _test_init_env in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_Initialize", referenced from:
[DEBUG   ]       _test_forced_io_encoding in _testembed.o
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]       _test_pre_initialization_api in _testembed.o
[DEBUG   ]       _test_pre_initialization_sys_options in _testembed.o
[DEBUG   ]       _test_bpo20891 in _testembed.o
[DEBUG   ]       _test_initialize_twice in _testembed.o
[DEBUG   ]       _test_initialize_pymain in _testembed.o
[DEBUG   ]       ...
[DEBUG   ]   "_Py_InspectFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_InteractiveFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_IsolatedFlag", referenced from:
[DEBUG   ]       _test_init_isolated in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_Main", referenced from:
[DEBUG   ]       _test_initialize_pymain in _testembed.o
[DEBUG   ]   "_Py_NewInterpreter", referenced from:
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]   "_Py_NoSiteFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_NoUserSiteDirectory", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_OptimizeFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_QuietFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_SetProgramName", referenced from:
[DEBUG   ]       _test_forced_io_encoding in _testembed.o
[DEBUG   ]       _test_repeated_init_and_subinterpreters in _testembed.o
[DEBUG   ]       _test_pre_initialization_api in _testembed.o
[DEBUG   ]       _test_pre_initialization_sys_options in _testembed.o
[DEBUG   ]       _test_bpo20891 in _testembed.o
[DEBUG   ]       _test_initialize_twice in _testembed.o
[DEBUG   ]       _test_initialize_pymain in _testembed.o
[DEBUG   ]       ...
[DEBUG   ]   "_Py_SetStandardStreamEncoding", referenced from:
[DEBUG   ]       _test_forced_io_encoding in _testembed.o
[DEBUG   ]   "_Py_UTF8Mode", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _test_init_from_config in _testembed.o
[DEBUG   ]   "_Py_UnbufferedStdioFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "_Py_VerboseFlag", referenced from:
[DEBUG   ]       _test_init_global_config in _testembed.o
[DEBUG   ]       _dump_config in _testembed.o
[DEBUG   ]   "__Py_FatalInitError", referenced from:
[DEBUG   ]       _test_init_from_config in _testembed.o
[DEBUG   ]       _test_init_dev_mode in _testembed.o
[DEBUG   ]       _test_init_isolated in _testembed.o
[DEBUG   ]   "__Py_InitializeFromConfig", referenced from:
[DEBUG   ]       _test_init_from_config in _testembed.o
[DEBUG   ]       _test_init_dev_mode in _testembed.o
[DEBUG   ]       _test_init_isolated in _testembed.o
[DEBUG   ] make: *** [python.exe] Error 1
[DEBUG   ] make: *** Waiting for unfinished jobs....
[DEBUG   ] ld: symbol(s) not found for architecture x86_64
[DEBUG   ] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[DEBUG   ] make: *** [Programs/_testembed] Error 1
Traceback (most recent call last):
  File "toolchain.py", line 1568, in <module>
    ToolchainCL()
  File "toolchain.py", line 1281, in __init__
    getattr(self, args.command)()
  File "toolchain.py", line 1322, in build
    build_recipes(args.recipe, ctx)
  File "toolchain.py", line 1158, in build_recipes
    recipe.execute()
  File "/Users/myname/Desktop/KiloGram/kivy-ios/toolchain.py", line 729, in execute
    self.build_all()
  File "/Users/myname/Desktop/KiloGram/kivy-ios/toolchain.py", line 84, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/myname/Desktop/KiloGram/kivy-ios/toolchain.py", line 837, in build_all
    self.build(arch)
  File "/Users/myname/Desktop/KiloGram/kivy-ios/toolchain.py", line 84, in _cache_execution
    f(self, *args, **kwargs)
  File "/Users/myname/Desktop/KiloGram/kivy-ios/toolchain.py", line 811, in build
    self.build_arch(arch)
  File "/Users/myname/Desktop/KiloGram/kivy-ios/toolchain.py", line 874, in build_arch
    getattr(self, build)()
  File "/Users/myname/Desktop/KiloGram/kivy-ios/recipes/hostpython3/__init__.py", line 91, in build_x86_64
    _env=build_env)
  File "/Users/myname/Desktop/KiloGram/kivy-ios/toolchain.py", line 67, in shprint
    for line in cmd:
  File "tools/external/sh.py", line 565, in next
    self.wait()
  File "tools/external/sh.py", line 500, in wait
    self.handle_command_exit_code(exit_code)
  File "tools/external/sh.py", line 516, in handle_command_exit_code
    raise exc(self.ran, self.process.stdout, self.process.stderr)
sh.ErrorReturnCode_2: 

  RAN: '/usr/bin/make -C /Users/myname/Desktop/KiloGram/kivy-ios/build/hostpython3/x86_64/Python-3.7.1 -j4'

  STDOUT:
clang -Qunused-arguments -fcolor-diagnostics -c -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -arch x86_64 -mmacosx-version-min=10.12 -I/Users/myname/Desktop/KiloGram/kivy-ios/dist/hostlibffi/usr/local/include -I/Users/myname/Desktop/KiloGram/kivy-ios/dist/include/x86_64/openssl --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -arch x86_64 -mmacosx-version-min=10.12 -I/Users/myname/Desktop/KiloGram/kivy-ios/dist/hostlibffi/usr/local/include -I/Users/myname/Desktop/KiloGram/kivy-ios/dist/include/x86_64/ope... (158396 more, please see e.stdout)

  STDERR:

【问题讨论】:

    标签: python macos linker kivy


    【解决方案1】:

    我遇到了类似的问题,我尝试使用 buildozer 看看它是否安装了其他东西但得到了相同的结果,但是有人建议在没有 venv 的情况下这样做,它对我的​​工作有效。

    https://github.com/kivy/kivy-ios/issues/401

    【讨论】:

      猜你喜欢
      • 2017-05-28
      • 2012-08-04
      • 2021-12-21
      • 2015-09-14
      • 2013-02-07
      • 1970-01-01
      • 2013-06-10
      • 2015-06-17
      相关资源
      最近更新 更多