Ndk compilation Common Errors-you know

Source: Internet
Author: User

==================================

Error:

Compile++ thumb  : AndroidCamera <= bufferqueue.cppjni/newBuffer/bufferqueue.cpp:10:17: fatal error: queue: No such file or directory

***

Answer:

Add application. mk:

APP_CFLAGS += -fexceptionsAPP_STL := gnustl_static

==================================

==================================

Error:

error: 'printf' was not declared in this scope

***

Answer: Add a header

#include "stdio.h"

==================================

==================================

Error:

/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/objs/AndroidCamera/newDecoder/DecodeLib.o: in function initDecode():jni/newDecoder/DecodeLib.cpp:29: error: undefined reference to 'avcodec_find_decoder'

***

Answer:

==================================

// Not in. find the method 'createqueue 'was not declared in this scope // not found in. c /. find the corresponding implementation androidcamera in CPP. CPP: 58: Error: Undefined reference to 'createqueue'

==================================

Error:

/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/libavcodec.a: no archive symbol table (run ranlib)

***

Answer:

victormatoiMac:newDecoder ericyang$ lipo -info libavcodec.a input file libavcodec.a is not a fat fileNon-fat file: libavcodec.a is architecture: armv7victormatoiMac:newDecoder ericyang$ lipo -info libavformat.a input file libavformat.a is not a fat fileNon-fat file: libavformat.a is architecture: armv7victormatoiMac:newDecoder ericyang$ lipo -info libavutil.a input file libavutil.a is not a fat fileNon-fat file: libavutil.a is architecture: armv7
victormatoiMac:TestCamera ericyang$ lipo -info jni/libx264.a lipo: archive with no architecture specification: jni/libx264.a (can't determine architecture for it)
victormatoiMac:TestCamera ericyang$ lipo -info jni/libCorePlot-CocoaTouch.a input file jni/libCorePlot-CocoaTouch.a is not a fat fileNon-fat file: jni/libCorePlot-CocoaTouch.a is architecture: armv7

victormatoiMac:newDecoder ericyang$ ranlib libavcodec.a victormatoiMac:newDecoder ericyang$ ranlib libavformat.a ranlib: file: libavformat.a(os_support.o) has no symbolsvictormatoiMac:newDecoder ericyang$ ranlib libavutil.a 

==================================

Old archive libiary -- error --- 0.10.2 --

SharedLibrary  : libAndroidCamera.so/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/libavcodec.a: no archive symbol table (run ranlib)/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/libavutil.a: no archive symbol table (run ranlib)/Users/ericyang/android-ndk-r8d/toolchains/arm-linux-androideabi-4.7/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi/libavformat.a: no archive symbol table (run ranlib)jni/newDecoder/DecodeLib.cpp:25: error: undefined reference to 'avcodec_register'jni/newDecoder/DecodeLib.cpp:29: error: undefined reference to 'avcodec_find_decoder'jni/newDecoder/DecodeLib.cpp:39: error: undefined reference to 'avcodec_alloc_context3'jni/newDecoder/DecodeLib.cpp:49: error: undefined reference to 'avcodec_alloc_frame'jni/newDecoder/DecodeLib.cpp:60: error: undefined reference to 'avcodec_open2'jni/newDecoder/DecodeLib.cpp:65: error: undefined reference to 'av_init_packet'jni/newDecoder/DecodeLib.cpp:68: error: undefined reference to 'ff_h264_decoder'jni/newDecoder/DecodeLib.cpp:74: error: undefined reference to 'avcodec_close'jni/newDecoder/DecodeLib.cpp:80: error: undefined reference to 'av_free'collect2: error: ld returned 1 exit status

Old archive libiary -- error --- 0.81 --

==================================

In file included from /Users/ericyang/android-ndk-r8d/platforms/android-14/arch-arm/usr/include/stdlib.h:40:0,                 from jni/newDecoder/ffmpeg/libavutil/log.c:32:/Users/ericyang/android-ndk-r8d/platforms/android-14/arch-arm/usr/include/string.h:58:15: note: previous declaration of 'strncasecmp' was herejni/newDecoder/ffmpeg/libavutil/log.c: In function 'colored_fputs':jni/newDecoder/ffmpeg/libavutil/log.c:109:21: error: implicit declaration of function 'isatty' [-Werror=implicit-function-declaration]

** Remove werror

==================================

/Users/ericyang/android-ndk-r8d/platforms/android-14/arch-arm/usr/include/string.h:58:15: note: previous declaration of 'strncasecmp' was hereIn file included from jni/newDecoder/ffmpeg/libavutil/parseutils.c:31:0:jni/newDecoder/ffmpeg/libavutil/parseutils.h:146:25: warning: 'struct tm' declared inside parameter list [enabled by default]jni/newDecoder/ffmpeg/libavutil/parseutils.h:146:25: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]jni/newDecoder/ffmpeg/libavutil/parseutils.c:450:74: warning: 'struct tm' declared inside parameter list [enabled by default]jni/newDecoder/ffmpeg/libavutil/parseutils.c: In function 'small_strptime':jni/newDecoder/ffmpeg/libavutil/parseutils.c:465:19: error: dereferencing pointer to incomplete typejni/newDecoder/ffmpeg/libavutil/parseutils.c:471:19: error: dereferencing pointer to incomplete typejni/newDecoder/ffmpeg/libavutil/parseutils.c:477:19: error: dereferencing pointer to incomplete typejni/newDecoder/ffmpeg/libavutil/parseutils.c:483:19: error: dereferencing pointer to incomplete typejni/newDecoder/ffmpeg/libavutil/parseutils.c:489:19: error: dereferencing pointer to incomplete typejni/newDecoder/ffmpeg/libavutil/parseutils.c:495:19: error: dereferencing pointer to incomplete type

==================================

==================================

==================================

==================================

==================================

==================================

==================================

==================================

Error:

***

Answer:

6.1 error: libavcodec/codec_names.h: no such file or directory

Source Document http://bbs.rosoo.net/thread-13749-1-1.html

Run in the FFMPEG directory

Cat libavcodec/avcodec. H | libavcodec/codec_names.sh config. h libavcodec/codec_names.h

==================================

Compiled logs in about 10 minutes.

Install        : libAndroidCamera.so => libs/armeabi/libAndroidCamera.so

==================================

Error:

***

Answer:

==================================

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.