未找到架构 armv7 的符号(在 Xcode 和 Python3 中运行存档时)

Posted

技术标签:

【中文标题】未找到架构 armv7 的符号(在 Xcode 和 Python3 中运行存档时)【英文标题】:symbol(s) not found for architecture armv7 (when running Archive in Xcode and Python3) 【发布时间】:2019-07-13 00:03:50 【问题描述】:

当我尝试创建存档失败的构建。该项目在ios模拟器上运行正常,在python3 + kivy-ios上运行,所有警告和错误:

ld: warning: directory not found for option '-L/Users/XX/kivy-ios/glomarkhome-ios/../build/lib'
ld: warning: directory not found for option '-F/Users/XX/kivy-ios/dist/frameworks'
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libsdl2_ttf.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libsdl2_ttf.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libpyobjus.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libpyobjus.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libffi.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libffi.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libfreetype.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libfreetype.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libsdl2_image.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libsdl2_image.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libsdl2_mixer.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libsdl2_mixer.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libcrypto.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libcrypto.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libssl.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libssl.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libsdl2.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libsdl2.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libios.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libios.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libkivy.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libkivy.a (2 slices)
ld: warning: ignoring file /Users/XX/kivy-ios/dist/lib/libpython3.a, missing required architecture armv7 in file /Users/XX/kivy-ios/dist/lib/libpython3.a (2 slices)
Undefined symbols for architecture armv7:
  "_PyEval_InitThreads", referenced from:
      _SDL_main in main.o
  "_PyMem_RawMalloc", referenced from:
      _SDL_main in main.o
  "_PyRun_SimpleFileExFlags", referenced from:
      _SDL_main in main.o
  "_PyRun_SimpleStringFlags", referenced from:
      _SDL_main in main.o
      _load_custom_builtin_importer in main.o
  "_PySys_SetArgv", referenced from:
      _SDL_main in main.o
  "_Py_DecodeLocale", referenced from:
      _SDL_main in main.o
  "_Py_Finalize", referenced from:
      _SDL_main in main.o
  "_Py_Initialize", referenced from:
      _SDL_main in main.o
  "_main", referenced from:
     implicit entry/start for main executable
     (maybe you meant: _SDL_main)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

所有库都包含在构建阶段 > 链接二进制 有什么想法吗?

【问题讨论】:

检查您的文件夹名称可能有问题,不接受空格 已确认。文件夹名称中没有空格。 或任何其他您需要复制并粘贴到项目目录中的文件夹或框架也请检查,获取参考的方法 已确认。整个项目中任何文件夹的名称中都没有空格。我不会复制和粘贴任何内容。 我在 Build Settings > Search Paths 上删除了项目中的所有路径,现在我只有一个错误,没有警告 【参考方案1】:

我解决了我的问题,这真的很简单。我把构建设置>架构>架构:$(ARCHS_STANDARD_64_BIT)

【讨论】:

你好!但是如果我们需要支持 armv7 设备怎么办?有什么方法可以构建项目,但如果设备具有 armv7 架构,则禁用此特定功能?

以上是关于未找到架构 armv7 的符号(在 Xcode 和 Python3 中运行存档时)的主要内容,如果未能解决你的问题,请参考以下文章

XCode 4.5 - 架构 armv7 的未定义符号

XCode - 架构 armv7 arm64 的未定义符号

无法构建发布应用程序 - 架构 armv7 的未定义符号

build.sh ios 使用 XCode6 Beta6 时生成“架构 armv7 的未定义符号”

XCode 4.5.2 的“架构的未定义符号”

未找到架构 armv7 颤振的符号