Compile error: library file not found

1. If the compilation time
reports an error that the library file cannot be found: /usr/bin/ld: warning: libswresample.so.3, needed by /usr/local/ffmpeg/lib/libavcodec.so, not found (try using -rpath or -rpath-link)

原因:
	Makefile里指定了链接库的路径,但是在此路径下没找到;
	-L /usr/local/ffmpeg/lib -lavformat -lavcodec -lavutil -lswscale
解决:
	添加链接库的环境变量:
		sudo vim /etc/profile
	在后面添加:
		export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/ffmpeg/lib
	保存后source一下:
		source /etc/profile
检查:
	aston@ubuntu:/mnt/hgfs/share/source_insight/main_17/MainCode$ echo $LD_LIBRARY_PATH
	:/usr/local/ffmpeg/lib

Two: The following error is reported when running the program after installing the ortp library:
aston@ubuntu:/mnt/hgfs/share/source_insight/main_86/mainCode1/test1/recv$ ./rtprecv
./rtprecv: error while loading shared libraries: libortp.so. 9: cannot open shared object file: No such file or directory

Reason: the dynamic library cannot be found when connecting;
solution:

1.查看如下路径下是否存在ortp库的配置文件;
$ ls /etc/ld.so.conf.d

2.如果不存在则创建,并写入ortp库的路径即可:
在ortp.conf文件中写入如下路径:
	/home/aston/workplace/ortp/ortp-0.24.2/install/lib

3.重新配置下链接库:
sudo ldconfig

Re-run the program

Guess you like

Origin blog.csdn.net/yanghangwww/article/details/103106110