sdk icon indicating copy to clipboard operation
sdk copied to clipboard

交叉编译问题

Open zhengqijun0121 opened this issue 4 years ago • 7 comments

可以用交叉编译工具链在其他平台上编译 sdk 吗?比如 QNX 和 Android ?

make PLATFORM=${QNX_HOST}/usr/bin/ntoaarch64 -j4

zhengqijun0121 avatar Jun 10 '21 07:06 zhengqijun0121

QNX没有编译过, android可以, 有Android的makefile

ireader avatar Jun 10 '21 09:06 ireader

Android编译遇到了问题

$ ndk-build NDK_PROJECT_PATH=. APP_PLATFORM=android-30 APP_BUILD_SCRIPT=./Android.mk 

[arm64-v8a] Compile++      : test <= test.cpp
[arm64-v8a] SharedLibrary  : libtest.so
ld: error: undefined symbol: sdp_a_rtpmap_test
>>> referenced by test.cpp:88 (./test/test.cpp:88)
>>>               ./obj/local/arm64-v8a/objs/test/test/test.o:(main)

ld: error: undefined symbol: rtsp_header_range_test
>>> referenced by test.cpp:89 (./test/test.cpp:89)
>>>               ./obj/local/arm64-v8a/objs/test/test/test.o:(main)

ld: error: undefined symbol: rtsp_header_rtp_info_test
>>> referenced by test.cpp:90 (./test/test.cpp:90)
>>>               ./obj/local/arm64-v8a/objs/test/test/test.o:(main)

ld: error: undefined symbol: rtsp_header_transport_test
>>> referenced by test.cpp:91 (./test/test.cpp:91)
>>>               ./obj/local/arm64-v8a/objs/test/test/test.o:(main)

ld: error: undefined symbol: rtsp_client_auth_test
>>> referenced by test.cpp:97 (./test/test.cpp:97)
>>>               ./obj/local/arm64-v8a/objs/test/test/test.o:(main)

ld: error: undefined symbol: rtsp_example
>>> referenced by test.cpp:140 (./test/test.cpp:140)
>>>               ./obj/local/arm64-v8a/objs/test/test/test.o:(main)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/home/user/Opt/android-ndk-r22b/build/core/build-binary.mk:728: obj/local/arm64-v8a/libtest.so] Error 1

zhengqijun0121 avatar Jun 17 '21 08:06 zhengqijun0121

看错误应该是makefile中没有添加这些文件,test的Android.mk文件是你自己添加的吗?

ireader avatar Jun 17 '21 08:06 ireader

移植到QNX平台的时候,发现不支持epoll机制,继续移植需要怎么做?

make -C libaio
make[2]: Entering directory '/home/zhengqijun/Project/rtsp_qnx/sdk/libaio'
../source/port/aio-socket-epoll.c:3:23: fatal error: sys/epoll.h: No such file or directory
compilation terminated.
../gcc.mk:91: recipe for target 'debug.qnx/objs/../source/port/aio-socket-epoll.o' failed
make[2]: *** [debug.qnx/objs/../source/port/aio-socket-epoll.o] Error 1

zhengqijun0121 avatar Jul 07 '21 03:07 zhengqijun0121

需要用到哪些功能? libaio目前应该只有libhttp需要, rtsp不依赖这个库。

ireader avatar Jul 07 '21 05:07 ireader

如果只编译rtsp相关的库和测试代码,需要哪些文件呢

zhengqijun0121 avatar Jul 07 '21 05:07 zhengqijun0121

如果只需要rtsp库,只需要编译librtsp和librtp,并且会依赖一些sdk下的文件,根据编译错误信息直接单独加到编译项目里就行; 如果需要用到rtsp_muxer/rtsp_demuxer,依赖libflv和avcodec; 如果需要用rtsp的aio库,需要依赖libaio‘

ireader avatar Jul 07 '21 06:07 ireader