簡體   English   中英

編譯testOnDemandRTSPServer.cpp時出錯(來自Live555庫)

[英]Error compiling testOnDemandRTSPServer.cpp (From the Live555 libraries)

我試圖找出如何從live555媒體服務器源的testProgs目錄中編譯testOnDemandRTSPServer.cpp 我正在使用Ubuntu 11.04,並已安裝liblivemedia-dev庫。

我已將標頭包含(在testOnDemandRTSPServer.cpp內)修改為:

#include <liveMedia/liveMedia.hh>
#include <BasicUsageEnvironment/BasicUsageEnvironment.hh>

並使用此命令進行編譯:

g++ -lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment testOnDemandRTSPServer.cpp -o RTSPServer

然后導致錯誤:

In file included from /usr/include/liveMedia/MediaSink.hh:25:0,
             from /usr/include/liveMedia/RTPSink.hh:25,
             from /usr/include/liveMedia/MultiFramedRTPSink.hh:26,
             from /usr/include/liveMedia/AudioRTPSink.hh:25,
             from /usr/include/liveMedia/MPEG1or2AudioRTPSink.hh:25,
             from /usr/include/liveMedia/liveMedia.hh:27,
             from testOnDemandRTSPServer.cpp:21:
/usr/include/liveMedia/FramedSource.hh:25:23: fatal error: NetCommon.h: No such file or directory
compilation terminated.

在這一點上,我想到了甜蜜的交易,這只是頭文件之間的重定向問題。 然后,我將/usr/include/liveMedia/FramedSource.hh修改為使用#include <groupsock/NetCommon.h>而不是#include "NetCommon.h" -因為NetCommon.h位於/ usr / include / groupsock /

這一直有效,直到發現一百萬其他重定向問題,例如:

  • /usr/include/liveMedia/Media.hh:29:22: fatal error: Boolean.hh: No such file or directory
  • /usr/include/liveMedia/Media.hh:33:31: fatal error: UsageEnvironment.hh: No such file or directory
  • 等等...

因此,我是應該首先正確鏈接到live555庫,還是必須根據需要不斷更改標頭位置?

更新資料

因此,我繼續使用上述方法更改標頭的位置,但是現在我收到了一百萬個未定義的引用錯誤... 如下所示 (對不起,在這里發布的內容太多了)

現在,我正在撓頭,因為原始的testOnDemandRTSPServer.cpp可以毫無障礙地進行編譯(使用configure / make方法)。 我唯一更改的是在哪里查找頭文件。

答案

通過根本不使用Ubuntu打包庫...而是僅通過Live555網站編譯源代碼。
在自定義的Makefile中,這是我用來編譯自己的程序和testOnDemandRTSPServer的結構:

LIVE_INCLUDES=-I../UsageEnvironment/include -I../groupsock/include -I../liveMedia/include -I../BasicUsageEnvironment/include
LIVE_LIBS=../liveMedia/libliveMedia.a ../groupsock/libgroupsock.a ../BasicUsageEnvironment/libBasicUsageEnvironment.a ../UsageEnvironment/libUsageEnvironment.a

g++ $(LIVE_INCLUDES) testOnDemandRTSPServer.c -c
g++ -o testOnDemandRTSPServer -L. testOnDemandRTSPServer.o $(LIVE_LIBS)

它也解決了未定義的參考錯誤:P

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM