Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/149.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ /usr/bin/ld:警告:找不到xxx需要的libavcodec.so.53_C++_Linux_Opencv_Makefile_Libavcodec - Fatal编程技术网

C++ /usr/bin/ld:警告:找不到xxx需要的libavcodec.so.53

C++ /usr/bin/ld:警告:找不到xxx需要的libavcodec.so.53,c++,linux,opencv,makefile,libavcodec,C++,Linux,Opencv,Makefile,Libavcodec,我试图用makefile编译给定的源代码,但我面临的问题是它使用libavcodec.so.53。安装的版本是54,libavutil和libavformat版本也不同于Linux版本。我无法在Linux中更改它们的版本,因为我没有根访问权限。因此,我将使用一个本地文件夹,其中包含opencv、libavutil.So、libavformat.So和libavcodec.So.53 我将此文件夹名称放入makefile.config,如下所示: INCLUDE_DIRS := $(PYTHON_

我试图用makefile编译给定的源代码,但我面临的问题是它使用libavcodec.so.53。安装的版本是54,libavutil和libavformat版本也不同于Linux版本。我无法在Linux中更改它们的版本,因为我没有根访问权限。因此,我将使用一个本地文件夹,其中包含opencv、libavutil.So、libavformat.So和libavcodec.So.53

我将此文件夹名称放入makefile.config,如下所示:

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /home/me/lib

LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local /home/me/lib
但当我编译它时,我有以下错误:

 /usr/bin/ld: warning: libavcodec.so.53, needed by 
 /home/anselmo/lib/lib/libopencv_highgui.so, not found (try using -
 rpath or -rpath-link)
/usr/bin/ld: warning: libavformat.so.53, needed by   
/home/me/lib/libopencv_highgui.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libavutil.so.51, needed by  
/home/me/lib/libopencv_highgui.so, not found (try using -rpath or  rpath-link)

/home/anselmo/lib/lib/libopencv_highgui.so: undefined reference to 
`avcodec_flush_buffers@LIBAVCODEC_53'
/home/me/lib/libopencv_highgui.so: undefined reference to  
`av_freep@LIBAVUTIL_51'
/home/me/lib/libopencv_highgui.so: undefined reference to        
`av_read_frame@LIBAVFORMAT_53'

libavutil.so.51、libavformat.so.53和libavcodec.so.53位于/home/me/lib中,如makefile中所示。如何向linux展示如何使用它们而不是机器上安装的那些?同样,我不能是root。

如果您将
/home/me/lib
路径放在第一位,那么它会工作吗?在我看来,链接器似乎首先搜索了错误的位置。我将尝试这个,谢谢。Building会给你这个错误吗?或者运行代码是什么?究竟是哪个命令生成了这些错误?make all命令给出了错误