文章目录
- 编译Android平台OpenCV,用到读取视频时报错:
- 解决
- 参考
编译Android平台OpenCV,用到读取视频时报错:
ld: error: undefined symbol: AMediaExtractor_new
ld: error: undefined symbol: AMediaExtractor_setDataSourceFd
ld: error: undefined symbol: AMediaExtractor_getTrackCount
ld: error: undefined symbol: AMediaExtractor_getTrackFormat
ld: error: undefined symbol: AMediaFormat_toString
ld: error: undefined symbol: AMEDIAFORMAT_KEY_MIME
ld: error: undefined symbol: AMediaFormat_getString
ld: error: undefined symbol: AMEDIAFORMAT_KEY_WIDTH
ld: error: undefined symbol: AMediaFormat_getInt32
ld: error: undefined symbol: AMEDIAFORMAT_KEY_HEIGHT
ld: error: undefined symbol: AMediaExtractor_selectTrack
ld: error: undefined symbol: AMediaCodec_createDecoderByType
ld: error: undefined symbol: AMediaCodec_configure
ld: error: undefined symbol: AMediaCodec_start
ld: error: undefined symbol: AMediaCodec_stop
ld: error: undefined symbol: AMediaCodec_delete
ld: error: undefined symbol: AMediaExtractor_delete
ld: error: undefined symbol: AMediaFormat_delete
ld: error: undefined symbol: AMediaCodec_getOutputFormat
ld: error: undefined symbol: AMediaCodec_dequeueOutputBuffer
ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:91: all] Error 2
解决
CMakeLists里添加mediandk就可以了
参考
https://blog.csdn.net/qq_24712507/article/details/117258343