1

在使用 ndk 为 android 编译 live555 时,我遇到了这个错误!

cd liveMedia ; make
make[1]: Entering directory `/home/jomit/Public/jimjh-liveMedia-for-Android-0c18fdd/liveMedia'
arm-linux-androideabi-ar cr libliveMedia.a -L/home/jomit/Applications/android-ndk-r6/sources/cxx-stl/gnu-libstdc++/libs/armeabi  \
    Media.o MediaSource.o FramedSource.o FramedFileSource.o FramedFilter.o ByteStreamFileSource.o ByteStreamMultiFileSource.o ByteStreamMemoryBufferSource.o BasicUDPSource.o DeviceSource.o AudioInputDevice.o WAVAudioFileSource.o MPEG1or2Demux.o MPEG1or2DemuxedElementaryStream.o MPEGVideoStreamFramer.o MPEG1or2VideoStreamFramer.o MPEG1or2VideoStreamDiscreteFramer.o MPEG4VideoStreamFramer.o MPEG4VideoStreamDiscreteFramer.o H264VideoStreamFramer.o H264VideoStreamDiscreteFramer.o MPEGVideoStreamParser.o MPEG1or2AudioStreamFramer.o MPEG1or2AudioRTPSource.o MPEG4LATMAudioRTPSource.o MPEG4ESVideoRTPSource.o MPEG4GenericRTPSource.o MP3FileSource.o MP3HTTPSource.o MP3Transcoder.o MP3ADU.o MP3ADUdescriptor.o MP3ADUinterleaving.o MP3ADUTranscoder.o MP3StreamState.o MP3Internals.o MP3InternalsHuffman.o MP3InternalsHuffmanTable.o MP3ADURTPSource.o MPEG1or2VideoRTPSource.o MPEG2TransportStreamMultiplexor.o MPEG2TransportStreamFromPESSource.o MPEG2TransportStreamFromESSource.o MPEG2TransportStreamFramer.o ADTSAudioFileSource.o H263plusVideoRTPSource.o H263plusVideoStreamFramer.o H263plusVideoStreamParser.o AC3AudioStreamFramer.o AC3AudioRTPSource.o DVVideoStreamFramer.o DVVideoRTPSource.o JPEGVideoSource.o AMRAudioSource.o AMRAudioFileSource.o InputFile.o MediaSink.o FileSink.o BasicUDPSink.o AMRAudioFileSink.o H264VideoFileSink.o MPEG1or2AudioRTPSink.o MP3ADURTPSink.o MPEG1or2VideoRTPSink.o MPEG4LATMAudioRTPSink.o MPEG4GenericRTPSink.o MPEG4ESVideoRTPSink.o H263plusVideoRTPSink.o H264VideoRTPSink.o DVVideoRTPSink.o AC3AudioRTPSink.o GSMAudioRTPSink.o JPEGVideoRTPSink.o SimpleRTPSink.o AMRAudioRTPSink.o TCPStreamSink.o OutputFile.o uLawAudioFilter.o RTPSource.o MultiFramedRTPSource.o SimpleRTPSource.o H261VideoRTPSource.o H264VideoRTPSource.o QCELPAudioRTPSource.o AMRAudioRTPSource.o JPEGVideoRTPSource.o RTPSink.o MultiFramedRTPSink.o AudioRTPSink.o VideoRTPSink.o RTPInterface.o RTCP.o rtcp_from_spec.o RTSPServer.o RTSPClient.o RTSPCommon.o RTSPServerSupportingHTTPStreaming.o SIPClient.o MediaSession.o ServerMediaSession.o PassiveServerMediaSubsession.o OnDemandServerMediaSubsession.o FileServerMediaSubsession.o MPEG4VideoFileServerMediaSubsession.o H264VideoFileServerMediaSubsession.o H263plusVideoFileServerMediaSubsession.o WAVAudioFileServerMediaSubsession.o AMRAudioFileServerMediaSubsession.o MP3AudioFileServerMediaSubsession.o MPEG1or2VideoFileServerMediaSubsession.o MPEG1or2FileServerDemux.o MPEG1or2DemuxedServerMediaSubsession.o MPEG2TransportFileServerMediaSubsession.o ADTSAudioFileServerMediaSubsession.o DVVideoFileServerMediaSubsession.o AC3AudioFileServerMediaSubsession.o QuickTimeFileSink.o QuickTimeGenericRTPSource.o AVIFileSink.o MPEG2IndexFromTransportStream.o MPEG2TransportStreamIndexFile.o MPEG2TransportStreamTrickModeFilter.o DarwinInjector.o BitVector.o StreamParser.o DigestAuthentication.o our_md5.o our_md5hl.o Base64.o Locale.o
arm-linux-androideabi-ar: -L/home/jomit/Applications/android-ndk-r6/sources/cxx-stl/gnu-libstdc++/libs/armeabi: No such file or directory
make[1]: *** [libliveMedia.a] Error 1
make[1]: Leaving directory `/home/jomit/Public/jimjh-liveMedia-for-Android-0c18fdd/liveMedia'
make: *** [all] Error 2

错误指出:

arm-linux-androideabi-ar: -L/home/jomit/Applications/android-ndk-r6/sources/cxx-stl/gnu-libstdc++/libs/armeabi: No such file or directory

但是我的/home/jomit/Applications/android-ndk-r6/sources/cxx-stl/gnu-libstdc++/libs/armeabi文件系统上确实有该目录。它是通过运行android ndk目录下的脚本make-standalone-toolchain.sh获得的。tools为了避免所有权限问题,我将所有权限授予 ndk 及其子目录,使用chmod 777 -R /home/jomit/Applications/android-ndk-r6/. 我的问题是如何解决这个错误?

笔记:

来自 github 的liveMedia-for-Android是我正在使用的 live555 android 端口。

我正在运行 64 位 Fedora 16。

以下是我android.sh正在运行以编译 live555 的文件:

#!/bin/sh
# 
# Builds libraries for Android
# Written by Jiunn Haur Lim <jim@jh-lim.com>

export PATH="${NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:${PATH}"

SYS_ROOT="${NDK_ROOT}/platforms/android-8/arch-arm"
PREF="arm-linux-androideabi-"
export LD="${PREF}ld  --sysroot=${SYS_ROOT}"

./genMakefiles android
make

exit 0

以下是config.android文件:

CROSS_COMPILE   ?=      arm-linux-androideabi-

SYS_ROOT        =       $(NDK_ROOT)/platforms/android-8/arch-arm

COMPILE_OPTS    =       $(INCLUDES) -I. -O2 -DSOCKLEN_T=socklen_t -DNO_SSTREAM=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fPIC --sysroot=$(SYS_ROOT) -DLINUX -DANDROID

C               =       c

C_COMPILER      =       $(CROSS_COMPILE)gcc

C_FLAGS         =       $(COMPILE_OPTS) -lc -lgcc

CPP             =       cpp

CPLUSPLUS_COMPILER =    $(CROSS_COMPILE)g++

CPLUSPLUS_FLAGS =       $(COMPILE_OPTS) -Wall -DBSD=1 -lstdc++ -lsupc++ \

                        -I$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/include \

                        -I$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include \

                        -L$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi 

OBJ             =       o

LINK            =       $(CROSS_COMPILE)g++ --sysroot=$(SYS_ROOT) -o 

LINK_OPTS       =       -L$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/libs/armeabi 

CONSOLE_LINK_OPTS =     $(LINK_OPTS)

LIBRARY_LINK    =       $(CROSS_COMPILE)ar cr 

LIBRARY_LINK_OPTS =     $(LINK_OPTS)

LIB_SUFFIX      =           a

LIBS_FOR_CONSOLE_APPLICATION =

LIBS_FOR_GUI_APPLICATION =

EXE =

这两个文件 -android.shconfig.android- 都是该端口已经可用的文件。

我真的很感谢任何帮助,因为谷歌在这个问题上有点缺乏知识:)

4

1 回答 1

0

问题是 GNU ar(在这种情况下为 arm-linux-androideabi-ar)不接受 -L 选项,这导致它将其视为文件(而不是动态时应该转到gcc/ld的路径选项链接)。

ar从一组目标文件编译静态库,因此不需要/尊重-L选项。

于 2012-04-24T12:47:18.830 回答