无法让mpg123在android上运行

时间:2017-04-21 06:25:53

标签: android c android-ndk cmake

我正在尝试为android编译mpg123并将mp3文件解码为pcm samples.I已使用cmake将mpg123库添加到项目中。我的CMakeLists.txt文件如下所示:

cmake_minimum_required(VERSION 3.4.1)

set(
PATH_TO_MPG123
"src/native/mpg123_1.24.0/src"
"src/native/mpg123_1.24.0/src/libmpg123"
"src/native/mpg123_1.24.0/src/libout123"
"src/native/mpg123_1.24.0/src/compat" )

file(GLOB_RECURSE MPG123_SRC src/native/mpg123_1.24.0/src/libmpg123/*.c)

add_library(
native-mpg123

SHARED

${MPG123_SRC} )

include_directories(${PATH_TO_MPG123})
link_directories(${PATH_TO_MPG123})
add_executable(exe src/main/cpp/mpg123_decoder.cpp)

find_library(
log-lib

log )

target_link_libraries(
exe

native-mpg123
${log-lib} )

但我遇到了几个错误:

Information:Gradle tasks [:app:assembleDebug]
Error:error: called object type 'int' is not a function or function pointer
Information:(Unknown) In file included
Error:error: '__overloadable__' attribute only applies to functions
Error:error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:error: use of undeclared identifier 'FIR_BUFFER_SIZE'
D:\Project\AndroidStudioProjects\Project2\app\src\native\mpg123_1.24.0\src\libmpg123\lfs_wrap.c
Warning:(171, 8) warning: implicit declaration of function 'MPG123_LARGENAME' is invalid in C99 [-Wimplicit-function-declaration]
Error:(171, 45) error: called object type 'int' is not a function or function pointer
Error:(191, 52) error: called object type 'int' is not a function or function pointer
Error:(211, 46) error: called object type 'int' is not a function or function pointer
Error:(228, 42) error: called object type 'int' is not a function or function pointer
Error:(245, 47) error: called object type 'int' is not a function or function pointer
Error:(262, 49) error: called object type 'int' is not a function or function pointer
Error:(279, 42) error: called object type 'int' is not a function or function pointer
Error:(297, 46) error: called object type 'int' is not a function or function pointer
Error:(318, 48) error: called object type 'int' is not a function or function pointer
Error:(335, 47) error: called object type 'int' is not a function or function pointer
Error:(362, 38) error: called object type 'int' is not a function or function pointer
Error:(435, 43) error: called object type 'int' is not a function or function pointer
Error:(477, 49) error: called object type 'int' is not a function or function pointer
Error:(494, 44) error: called object type 'int' is not a function or function pointer
Error:(509, 46) error: called object type 'int' is not a function or function pointer
Error:(671, 55) error: called object type 'int' is not a function or function pointer
Error:(699, 43) error: called object type 'int' is not a function or function pointer
Error:(722, 55) error: called object type 'int' is not a function or function pointer
Warning:(171, 8) warning: implicit declaration of function 'MPG123_LARGENAME' is invalid in C99 [-Wimplicit-function-declaration]
Error:(171, 45) error: called object type 'int' is not a function or function pointer
Error:(191, 52) error: called object type 'int' is not a function or function pointer
Error:(211, 46) error: called object type 'int' is not a function or function pointer
Error:(228, 42) error: called object type 'int' is not a function or function pointer
Error:(245, 47) error: called object type 'int' is not a function or function pointer
Error:(262, 49) error: called object type 'int' is not a function or function pointer
Error:(279, 42) error: called object type 'int' is not a function or function pointer
Error:(297, 46) error: called object type 'int' is not a function or function pointer
Error:(318, 48) error: called object type 'int' is not a function or function pointer
Error:(335, 47) error: called object type 'int' is not a function or function pointer
Error:(362, 38) error: called object type 'int' is not a function or function pointer
Error:(435, 43) error: called object type 'int' is not a function or function pointer
Error:(451, 41) error: called object type 'int' is not a function or function pointer
Error:(477, 49) error: called object type 'int' is not a function or function pointer
Error:(494, 44) error: called object type 'int' is not a function or function pointer
Error:(509, 46) error: called object type 'int' is not a function or function pointer
Error:(671, 55) error: called object type 'int' is not a function or function pointer
Error:(699, 43) error: called object type 'int' is not a function or function pointer
Error:(722, 55) error: called object type 'int' is not a function or function pointer
Information:note: expanded from macro 'error2'
C:\Users\MRM\AppData\Local\Android\Sdk\ndk-bundle\android-ndk-r13b\platforms\android-21\arch-mips64\usr\include\unistd.h
Information:(163, 12) 'getopt' declared here
Information:(163, 12) 'getopt' declared here
extern int getopt(int, char * const *, const char 
Information:(163, 12) note: 'getopt' declared here
Information:(163, 12) note: 'getopt' declared here
Information:(163, 12) note: 'getopt' declared here
D:\Project\AndroidStudioProjects\Project2\app\src\native\mpg123_1.24.0\src\libmpg123\optimize.c
Error:(139, 34) error: use of undeclared identifier 'defopt'; did you mean 'getopt'?
Error:(513, 34) error: use of undeclared identifier 'defopt'; did you mean 'getopt'?
Warning:(513, 31) warning: comparison between pointer and integer ('unsigned int' and 'int (*)(int, char *const *, const char *)')
Error:(515, 79) error: use of undeclared identifier 'defopt'; did you mean 'getopt'?
Warning:(515, 79) warning: format specifies type 'int' but the argument has type 'int (*)(int, char *const *, const char *)' [-Wformat]
Error:(139, 34) error: use of undeclared identifier 'defopt'; did you mean 'getopt'?
Error:(513, 34) error: use of undeclared identifier 'defopt'; did you mean 'getopt'?
Warning:(513, 31) warning: comparison between pointer and integer ('unsigned int' and 'int (*)(int, char *const *, const char *)')
Error:(515, 79) error: use of undeclared identifier 'defopt'; did you mean 'getopt'?
Warning:(515, 79) warning: format specifies type 'int' but the argument has type 'int (*)(int, char *const *, const char *)' [-Wformat]
Information:note: expanded from macro 'error2'
D:\Project\AndroidStudioProjects\Project2\app\src\native\mpg123_1.24.0\src\libmpg123\getcpuflags_arm.c
Error:(31, 6) error: no member named 'has_neon' in 'struct cpuflags'
Error:(35, 7) error: no member named 'has_neon' in 'struct cpuflags'
Error:(31, 6) error: no member named 'has_neon' in 'struct cpuflags'
Error:(35, 7) error: no member named 'has_neon' in 'struct cpuflags'
C:\Users\MRM\AppData\Local\Android\Sdk\ndk-bundle\android-ndk-r13b\toolchains\llvm\prebuilt\windows-x86_64\lib64\clang\3.8.256229\include\altivec.h
Error:(27, 2) error: "AltiVec support not enabled"
Error:(39, 8) error: unknown type name 'vector'
Error:(39, 15) error: expected identifier or '('
Error:(43, 8) error: unknown type name 'vector'
Error:(43, 15) error: expected identifier or '('
Error:(47, 8) error: unknown type name 'vector'
Error:(47, 19) error: expected ';' after top level declarator
Error:(47, 47) error: unknown type name 'vector'
Error:(47, 59) error: expected ')'
Information:(47, 46) to match this '('
Error:(51, 8) error: unknown type name 'vector'
Error:(51, 15) error: expected identifier or '('
Error:(55, 8) error: unknown type name 'vector'
Error:(55, 15) error: expected identifi
Error:(59, 8) error: unknown type name 'vector'
Error:(59, 19) error: expected ';' after top level declarator
Error:(59, 48) error: unknown type name 'vector'
Error:(59, 60) error: expected ')'
Information:(59, 47) to match this '('
Error:(63, 8) error: unknown type name 'vector'
Information:(37, 37) expanded from macro '__ATTRS_o_ai'
Error:(27, 2) error: "AltiVec support not enabled"
Error:(39, 8) error: unknown type name 'vector'
Error:(39, 15) error: expected identifier or '('
Error:(43, 8) error: unknown type name 'vector'
Error:(43, 15) error: expected identifier or '('
Error:(47, 8) error: unknown type name 'vector'
Error:(47, 19) error: expected ';' after top level declarator
Error:(47, 47) error: unknown type name 'vector'
Error:(47, 59) error: expected ')'
Information:(47, 46) note: to match this '('
Error:(51, 8) error: unknown type name 'vector'
Error:(51, 15) error: expected identifier or '('
Error:(55, 8) error: unknown type name 'vector'
Error:(55, 15) error: expected identifier or '('
Error:(59, 8) error: unknown type name 'vector'
Error:(59, 19) error: expected ';' after top level declarator
Error:(59, 48) error: unknown type name 'vector'
Error:(59, 60) error: expected ')'
Information:(59, 47) note: to match this '('
Error:(63, 8) error: unknown type name 'vector'
Error:(63, 21) error: '__overloadable__' attribute only applies to functions
Information:(37, 37) note: expanded from macro '__ATTRS_o_ai'
D:\Project\AndroidStudioProjects\Project2\app\src\native\mpg123_1.24.0\src\libmpg123\dct64_i486.c
Information:(54, 32) expanded from macro 'SETOUT'
Error:(265, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(266, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(267, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(268, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) expanded from macro 'S
ETOUT'
Error:(269, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(270, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(271, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(272, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(275, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(277, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(279, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(281, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(283, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(287, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(288, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(291, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Error:(292, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) expanded from macro 'SETOUT'
#define SETOUT(out,n,expr) out[FIR_BUFFER_SIZE*(n)]
Error:(264, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(265, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(266, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(267, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(268, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(269, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(270, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(271, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(272, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(275, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(277, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(279, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(281, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(283, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(285, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(287, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(288, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(291, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Error:(292, 2) error: use of undeclared identifier 'FIR_BUFFER_SIZE'
Information:(54, 32) note: expanded from macro 'SETOUT'
Information:BUILD FAILED
Information:Total time: 2.08 secs
Information:124 errors
Information:6 warnings
Information:See complete output in console

我做错了什么?

0 个答案:

没有答案