編譯rtmpdump,運行環境ubuntu10.0.4
1.下載地址:
http://rtmpdump.mplayerhq.hu/ ,如圖:
我是用git方式下載的,下下來版本是2.4。
看了一下README檔案,make時需要加參數SYS=posix。不過看了Makefile,這個參數預設就是posix,所以可以不加。
但是如果把產生的庫安裝到指定路徑,需要修改Makefile,例prefix=/usr。注意 librtmp/Makefile 也需要修改。
執行make,發現缺少openssl和zlib庫的支援。依然去上圖的網站下載。
2.安裝openssl:
http://www.openssl.org/ 我下的是1.0.1f版本。
tar zxvf openssl-1.0.1f.tar.gz
cd openssl-1.0.1f
./config --prefix=/usr
make
sudo make install
3.然後安裝zlib:
tar zxvf zlib-1.2.8.tar.gz ,解壓時出現一點錯誤,但是不要僅。
cd zlib-1.2.8
make test (參數是看了readme後加的)
sudo make install
4.再回來繼續安裝rtmpdump
make
gcc -Wall -o rtmpdump rtmpdump.o -Llibrtmp -lrtmp -lssl -lcrypto -lz
librtmp/librtmp.so: undefined reference to `dlsym'
librtmp/librtmp.so: undefined reference to `dlerror'
librtmp/librtmp.so: undefined reference to `dladdr'
librtmp/librtmp.so: undefined reference to `dlopen'
librtmp/librtmp.so: undefined reference to `dlclose'
collect2: ld returned 1 exit status
這個需要加上dl庫。修改rtmpdump-2.4這個目錄下的Makefile
gedit Makefile,找到第25行,在後面加上 -ldl
LDFLAGS=-Wall $(XLDFLAGS) -ldl
然後再make和make install。
make install之前,我已經修改了兩人Makefile中的安裝路徑: