1. 移植到DM6446開發闆
22-Feb-2012 16:22
503K
2)庫檔案編譯
解壓到 /opt/ortp-0.20.0
進入主目錄:cd /opt/ortp-0.20.0
執行如下指令:
a ) ./configure --prefix=/opt/ortp --host=arm-montavista-linux --disable-staticCC=arm_v5t_le-gcc
b)make
c)makeinstall
注:執行make時程式報錯我們把檔案/ortp-0.20.0/src/b64.c 中209-212行注釋掉即可
#ifndef__WATCOMC__
// assert(characters[0] >= 0&& characters[0] < 64);
// assert(characters[1] >= 0&& characters[1] < 64);
// assert(characters[2] >= 0 &&characters[2] < 64);
// assert(characters[3] >= 0 &&characters[3] < 64);
#endif
完成後在/opt/ortp目錄下生成檔案夾
3)複制頭檔案和庫檔案
a)把 include下的ortp檔案夾拷貝到
/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/lib/gcc/armv5tl-montavista-linuxeabi/3.4.3/include檔案夾下,注意:是将整個ortp檔案下一起拷貝,如果隻拷貝裡面的.h檔案,在程式編譯時會報錯。
b)把lib檔案夾裡邊的除檔案夾pkgconfig以外的檔案拷貝到
/opt/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le/armv5tl-montavista-linuxeabi/lib
c)為了能在DM6446平台上運作程式,需要把庫檔案和頭檔案拷貝到嵌入式檔案系統中。分别拷貝到\usr\lib和\usr\include中。
到此ortp的交叉編譯環境移植成功。
2. 移植到linux PC機
進入主目錄:cd /opt/ortp-0.20.0
執行如下指令:
a)./configure
b)make
c)makeinstall
裝好以後系統環境如下,靜态動态庫安裝到了/usr/local/lib目錄下,包括libortp.la、libortp.so libortp.so.8 libortp.so.8.0.0。頭檔案在/usr/local/include目錄ortp目錄下。
庫檔案複制到/usr/lib檔案夾下,頭檔案複制到/usr/include下。
3. 程式編譯與測試
1) PC端程式編譯
gcc rtp rtprecv.c–o rtprecv –lortp編譯接收端程式
2) ARM端程式編譯
arm_v5t_le-gcc rtpsend.c –o rtpsend_arm –lortp 編譯ARM端發送程式
3) 測試
分别在PC端運作./rtprecv test 5000
在ARM端運作 ./rtpsend_arm test10.108.20.26 5000
可完成從ARM端發送檔案test到PC端。