linux下編譯rtmpdump__linux

來源:互聯網
上載者:User

編譯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中的安裝路徑:


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.