简体   繁体   English

铛:错误:链接器命令失败,退出代码1仅在设备上出现

[英]clang: error: linker command failed with exit code 1 coming only on device

When i'm trying to test my app on device i get the below error. 当我尝试在设备上测试我的应用程序时,出现以下错误。 The error is not coming in simulator. 该错误不会出现在模拟器中。 I'm using xcode 7. Can someone please help? 我正在使用xcode7。有人可以帮忙吗?

Undefined symbols for architecture armv7: "_PKCS5_PBKDF2_HMAC_SHA1", referenced from: _sqlcipher_cipher_ctx_key_derive in sqlcipher.a(sqlite3.o) "_HMAC_CTX_init", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_HMAC_Init_ex", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_HMAC_Final", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_HMAC_CTX_cleanup", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_RAND_bytes", referenced from: _sqlcipher_page_cipher in sqlcipher.a(sqlite3.o) _sqlcipher_codec_ctx_init in sqlcipher.a(sqlite3.o) "_HMAC_Update", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_EVP_CIPHER_CTX_set_padding", referenced from: _sqlcipher_page_cipher in sqlcipher.a(sqlite3.o) "_EVP_CipherInit", referenced from: _sqlcipher_page_cipher in sqlcipher.a(sqlite3.o) "_EVP_CipherFinal", referenced from: _sqlcipher_page_cipher in sqlcipher.a(sqlite3.o) "_EVP_get_cipherbyname", referenced from: _sqlc 架构armv7的未定义符号:“ _ PKCS5_PBKDF2_HMAC_SHA1”,引用自:sqlcipher.a(sqlite3.o)中的_sqlcipher_cipher_ctx_key_derive。 .a(sqlite3.o)“ _HMAC_Final”,引用自:sqlcipher中的_sqlcipher_page_hmac。a(sqlite3.o)“ _HMAC_CTX_cleanup”,引用自:sqlcipher.a中的_sqlcipher_page_hmac。 sqlcipher.a(sqlite3.o)中的sqlcipher.a(sqlite3.o)_HMAC_Update中的_sqlcipher_codec_ctx_init,引用自:sqlcipher.a中的_sqlcipher_page_hmac,sqlcipher.a中的_sqlcipher_page_hmac o)“ _EVP_CipherInit”,引用自:sqlcipher.a(_sqlite3.o)中的_sqlcipher_page_cipher,引用自:sqlcipher.a的_sqlcipher_page_cipher。 ipher_codec_ctx_set_cipher in sqlcipher.a(sqlite3.o) _sqlcipher_activate in sqlcipher.a(sqlite3.o) "_OPENSSL_add_all_algorithms_noconf", referenced from: _sqlcipher_activate in sqlcipher.a(sqlite3.o) "_EVP_MD_size", referenced from: _sqlcipher_codec_ctx_set_cipher in sqlcipher.a(sqlite3.o) "_EVP_sha1", referenced from: _sqlcipher_codec_ctx_set_cipher in sqlcipher.a(sqlite3.o) _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_EVP_CIPHER_key_length", referenced from: _sqlcipher_codec_ctx_set_cipher in sqlcipher.a(sqlite3.o) "_EVP_CipherUpdate", referenced from: _sqlcipher_page_cipher in sqlcipher.a(sqlite3.o) "_EVP_CIPHER_iv_length", referenced from: _sqlcipher_codec_ctx_set_cipher in sqlcipher.a(sqlite3.o) "_EVP_CIPHER_CTX_cleanup", referenced from: _sqlcipher_page_cipher in sqlcipher.a(sqlite3.o) "_EVP_CIPHER_block_size", referenced from: _sqlcipher_codec_ctx_set_cipher in sqlcipher.a(sqlite3.o) ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit sqlcipher.a(sqlite3.o)中的ipher_codec_ctx_set_cipher sqlcipher.a(sqlite3.o)中的_sqlcipher_activate“ _OPENSSL_add_all_algorithms_noconf”,引用自:_cipcipher_a中的_sqlcipher_activate。 sqlite3.o)“ _ EVP_sha1”,引用自:sqlcipher.a中的_sqlcipher_codec_ctx_set_cipher。sql(.sql).a(sqlite3.o)_sqlcipher_page_hmac。 ”,引用自:sqlcipher.a(sqlite3.o)中的_sqlcipher_page_cipher。_EVP_CIPHER_iv_length引用自:sqlcipher.a的_sqlcipher_codec_ctx_set_cipher引用。 _EVP_CIPHER_block_size”,引用自:sqlcipher.a(sqlite3.o)中的_sqlcipher_codec_ctx_set_cipher ld:体系结构armv7 clang找不到符号:错误:链接器命令失败,退出 code 1 (use -v to see invocation) 代码1(使用-v查看调用)

The common causes for "Undefined symbols for architecture armv7" are: “体系结构armv7的未定义符号”的常见原因是:

  1. You import a header and do not link against the correct library. 您导入标头,并且不链接到正确的库。 This is common, especially for headers for libraries like QuartzCore since it is not included in projects by default. 这是常见的,尤其是对于像QuartzCore这样的库的头文件,因为默认情况下它不包含在项目中。 To resolve: 解决:

    • Add the correct libraries in the Link Binary With Libraries section of the Build Phases. 在构建阶段的使用库链接二进制文件部分中添加正确的库。

    • If you want to add a library outside of the default search path you can include the path in the Library Search Paths value in the Build Settings and add -l{library_name_without_lib_and_suffix} (eg. for libz.a use -lz) to the Other Linker Flags section of Build Settings. 如果要在默认搜索路径之外添加库,可以将该路径包括在“构建设置”的“库搜索路径”值中,并将-l{library_name_without_lib_and_suffix} (例如,对于libz.a使用-lz)添加到其他链接器中构建设置的标志部分。

  2. You copy files into your project but forgot to check the target to add the files to. 您将文件复制到项目中,但忘记了检查目标以将文件添加到其中。 To resolve: 解决:

    • Open the Build Phases for the correct target, expand Compile Sources and add the missing .m files. 打开正确目标的构建阶段,展开“编译源”并添加缺少的.m文件。

You include a static library that is built for another architecture like i386, the simulator on your host machine. 您包括一个静态库,该库是为另一种体系结构(如i386)(主机上的模拟器)构建的。 To resolve: 解决:

If you have multiple library files from your libraries vendor to include in the project you need to include the one for the simulator (i386) and the one for the device (armv7 for example). 如果您有多个库供应商的库文件要包含在项目中,则需要包含一个用于模拟器(i386)和一个用于设备的库文件(例如armv7)。

These are OpenSSL symbols, so you are probably not linking against libcrypto. 这些是OpenSSL符号,因此您可能未针对libcrypto进行链接。 Add -lcrypto to the linker flags. 将-lcrypto添加到链接器标志。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 clang:错误:仅在设备上测试时,链接器命令失败,退出代码为1 - clang: error: linker command failed with exit code 1, only when testing on device 链接器命令失败,退出代码1 clang:错误 - linker command failed with exit code 1 clang:error 铛:错误:链接器命令失败,退出代码为1,Xcode链接器错误 - clang: error: linker command failed with exit code 1, Xcode Linker Error 解析应用无法在实际设备上运行“ clang:错误:链接器命令失败,退出代码为1” Swift 2.0 Xcode 7 beta 6 - Parse app not working on real device “clang: error: linker command failed with exit code 1” Swift 2.0 Xcode 7 beta 6 铛:错误:链接器命令失败,退出代码为1 [Jenkins] - clang: error: linker command failed with exit code 1 [ Jenkins ] clang:错误:链接器命令失败,退出代码为1,react-native - clang: error: linker command failed with exit code 1, react-native Unity,Xcode和Clang:错误:链接器命令失败,退出代码为1 - Unity, Xcode and clang: error: linker command failed with exit code 1 铛:错误:链接器命令失败,退出代码为1 iOS9 - clang: error: linker command failed with exit code 1 iOS9 clang:错误:归档时链接器命令失败,退出代码为1 - clang: error: linker command failed with exit code 1 when archiving 使用Pod安装后出现Swift错误(铛:错误:链接器命令失败,退出代码为1) - Swift error after using pod install (clang: error: linker command failed with exit code 1 )
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM