編譯arm64錯誤記錄


響應2月底appstore 64位APP的上線要求,開始編譯IOS arm64版本引擎庫。
編譯arm64遇到一些問題,在此記錄。

1. 數據類型的錯誤 __int64 相關,提示error: expected  ';' after top level declarator
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
改為
typedef long long int64_t;
typedef unsigned long long uint64_t;
其中:
__int64為微軟MSVC定義的數據類型,long long為C99定義的數據類型。
相關說明可參看blog http://blog.csdn.net/shiwei408/article/details/7463476

2. 隱式聲明函數報錯
error: implicit declaration of function 'SynthesisPolyphaseFiltering' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
其中
void SynthesisPolyphaseFiltering() 定義在另外一個.c文件中,並沒有在相應的.h頭文件聲明。
經網友們幫忙,應該是gcc默認帶參數-Werror=implicit-function-declaration,將警告
implicit-function-declaration做為error處理。
解決方法:
a. 如果函數定義在頭文件中,將頭文件引入 #include "XXX.h"
b. 如果是直接定義在.c文件中的隱式聲明,
在引用的.c文件中添加 extern void SynthesisPolyphaseFiltering();
或者 通過編譯選項,禁用這個警告
-Wno-error -Wno-implicit-function-declaration

3. has no symbols 提示
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool: for architecture: armv7 file: libaacdec_armv7.a(ad_lt_predict_armv7.o) has no symbols

$ nm ad_lt_predict_armv7.o 提示 no name list

看一下源文件ad_lt_predict.c 發現整個.c文件 定義在 #ifdef LTP_DEC 下
而我的編譯選項沒有使用LTP_DEC。這樣看來當然不會編譯進來了,在編譯選項中去掉這個c文件。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM