mstorsjo / fdk-aac

A standalone library of the Fraunhofer FDK AAC code from Android.
https://sourceforge.net/projects/opencore-amr/
Other
1.18k stars 389 forks source link

NDK cross compilation missing file #124

Open pengfalin opened 4 years ago

pengfalin commented 4 years ago

NDK version:14 lib-aac version:2.0.1

libSBRdec/src/lpp_tran.cpp:122:21: fatal error: log/log.h: No such file or directory

include "log/log.h"

mstorsjo commented 4 years ago

This project isn't buildable as such directly with the android NDK. If you really want to, it should be fairly straightforward to comment out a few android specific ifdef blocks (they contain code that only build in the android platform codebase, not with the NDK).

There's a couple reasons for not actively supporting building for android:

pengfalin commented 4 years ago

Thanks, I want to use ffmpeg cross compilation, and link fdk-aac and x264. I hope to use JNI development to write my own C + + code. I finally used version 2.0.0 and successfully linked to ffmpeg. I will try to compile version 2.0.1 when I have time.

dnovikov commented 3 years ago

I got one step further while experimenting with the mobile-ffmpeg project:

  1. Installed the android-libcutils-dev package.
  2. Changed "log/log.h" to <cutils/log.h>

This fixed the error message above.

Now it fails on following:

lib/libfdk-aac.a(lpp_tran.o):lpp_tran.cpp:function lppTransposer(SBR_LPP_TRANS*, QMF_SCALE_FACTOR*, long**, long*, long**, int, int, int, int, int, int, int, INVF_MODE*, INVF_MODE*): error: undefined reference to '__android_log_error_write'
diasgc commented 2 years ago

The missing file is here, download and patch it: curl "https://android.googlesource.com/platform/system/bt/+/master/linux_include/log/log.h?format=TEXT" | base64 --decode | sed 's/OS_GENERIC/__ANDROID__/' >libSBRdec/include/log/log.h

act262 commented 2 years ago

patch this script fix it.

dumy missing log.h, ignore function impl.

mkdir -p libSBRdec/include/log/

echo "void android_errorWriteLog(int i, const char *string){}" > libSBRdec/include/log/log.h
pengfalin commented 2 years ago

您好,你的邮件我已收到,谢谢你对我工作的支持

zhubinsheng commented 1 year ago

该项目不能直接使用 android NDK 构建。如果你真的想要,注释掉一些 android 特定的 ifdef 块应该相当简单(它们包含仅在 android 平台代码库中构建的代码,而不是 NDK)。

2.0.1 fail

pengfalin commented 1 year ago

您好,你的邮件我已收到,谢谢你对我工作的支持

pengfalin commented 1 year ago

您好,你的邮件我已收到,谢谢你对我工作的支持

liungkejin commented 1 year ago

patch this script fix it.

dumy missing log.h, ignore function impl.

mkdir -p libSBRdec/include/log/

echo "void android_errorWriteLog(int i, const char *string){}" > libSBRdec/include/log/log.h

This is the right solution!