• libmt.so: undefined reference to `av_find_stream_info@LIBAVFORMAT_53'


    [root@localhost instance]# make
    gcc -O3 -g -I/usr/include/ -I/usr/include/glib-2.0 -I/usr/include/glib-2.0/glib -I/usr/include/glib-2.0/gobject -I/usr/lib/glib-2.0/include -I../../../common -I../../../protocol -I../../../cache -I../../../capture -I../../../accessor -I../../../analyse -I../../../log -I/usr/include/mysql  -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -fwrapv -DVER_WCDMA  -c main.c -o obj/main.o -DCAP_RSS -DRUN_NOM
    gcc -O3 -g -o ../../../../bin/msaVqosAnalyzer obj/main.o -lpthread -lrt -g -lm ../../../../lib/librsscap.a -L ../../../../lib  -lLog -lxml2  -lCommon -lAccessor -lCache  -lProtocol -lCapture -lSimulateCapture -lglib-2.0 -lgthread-2.0 -lAnalyse -lmt -rdynamic -L/usr/lib64/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -L/usr/lib64 -lssl -lcrypto
    /usr/bin/ld: warning: libavformat.so.53, needed by ../../../../lib/libmt.so, not found (try using -rpath or -rpath-link)
    ../../../../lib/libmt.so: undefined reference to `avformat_open_input@LIBAVFORMAT_53'
    ../../../../lib/libmt.so: undefined reference to `av_probe_input_buffer@LIBAVFORMAT_53'../../../../lib/libmt.so: undefined reference to `get_content'
    collect2: ld returned 1 exit status
    make: *** [../../../../bin/msaVqosAnalyzer] Error 1
    [root@localhost instance]# 

    编译makefile时出现上述错误,找不到指定的符号

    解决思路:1.编译过程中未找到libavformat.so.53库 2.符号未定义

    一 libmt.so依赖libavformat.so.53,其中包含解码调用, libmt.so中解析模块,在整体编译工程时, 连接时出错。

                  LIB := ../../../../lib/librsscap.a -L ../../../../lib  -lmt   

    gcc 编译时加入了-lmt 连接libmt.so,理论上会去 ../../../../lib -L指定的路径寻找libavformat.so.53库,但是确没有,而libmt.so已经查找到。

              LIB := ../../../../lib/librsscap.a -L ../../../../lib  -lmt   -lavfromat

    二 undefined reference to `get_content‘ 这个错误发现不是一导致的,通过

          nm ../lib/libmt.so |grep  get_content

        发现是显示U,未定义的。查询源代码,在定义的地方 get_content定义 static函数, 但是外部却调用了。 去掉static ok。

    注: sourceInsight 在添加文件,重命名文件一定要记得重新同步工程,否则导致lookup references时,显示不到存在的调用, 实际存在调用,上述二犯错误的间接导致。

  • 相关阅读:
    struts.xml
    web.xml
    jdbc.properties
    apache+tomcat的集群--Session复制配置
    mysql 定时触发器
    mysql 查看存储过程
    Quatz 定时任务
    Apache Httpd常用命令
    Mac安装nginx
    dubbo ReferenceConfig源码分析
  • 原文地址:https://www.cnblogs.com/iclk/p/4046721.html
Copyright © 2020-2023  润新知