2011-03-11 25 views
0

當我嘗試在我的簡單項目中使用jrtplib和jthread進行編譯時,出現一些鏈接錯誤問題。的錯誤是:關於jrtplib和jthread的幫助

Error 4 fatal error LNK1120: 3 unresolved externals C:\Users\Chicko\Desktop\tryout\Debug\tryout.exe 
Error 1 error LNK2019: unresolved external symbol "public: virtual __thiscall RTPSession::~RTPSession(void)" ([email protected]@[email protected]) referenced in function _wmain tryout.obj 
Error 2 error LNK2019: unresolved external symbol "public: __thiscall RTPSessionParams::RTPSessionParams(void)" ([email protected]@[email protected]) referenced in function _wmain tryout.obj 
Error 3 error LNK2019: unresolved external symbol "public: __thiscall RTPSession::RTPSession(class RTPRandom *,class RTPMemoryManager *)" ([email protected]@[email protected]@@[email protected]@@Z) referenced in function _wmain tryout.obj 

,這裏是我的主要程序:

// tryout.cpp : Defines the entry point for the console application. 
// 

#include "stdafx.h" 
#include <rtpsession.h>    //Confused to put "" or <> 
#include <rtpsessionparams.h> 
#include <rtpudpv4transmitter.h> 

int _tmain(int argc, _TCHAR* argv[]) 
{ 
    RTPSession session; 
    RTPSessionParams sessionparams; 
    RTPUDPv4TransmissionParams transparams; 

    sessionparams.SetOwnTimestampUnit(1.0/8000.0); 
    transparams.SetPortbase(8000); 

    return 0; 
} 

爲了您的信息,我不導入從這些庫中的任何頭文件到我的項目。我在項目設置中使用額外的包含庫,並將`"..\jlib\jthread-1.2.1\src";"..\jlib\jrtplib3.8.2\src"(這是存儲所有頭文件的文件夾)。我該如何解決?我應該在哪裏放jrtplib.libjthread.lib?請幫助...

回答

0

您是否在項目鏈接器選項下添加了jrtplib.lib和jthread.lib?

可以將項目屬性頁上做下

「配置屬性 - >連接器 - >輸入 - >附加依賴」,並確保它包含的lib文件的目錄已添加到您的庫路徑:無論是在項目屬性

「連接器 - >常規 - >附加庫目錄」

或在全局VS設置(不適用於VC2010)

「工具 - >選項」「項目等等lutions-> VC++目錄 - >庫文件「

在VC2010下,你將不得不編輯項目的屬性表。

+0

我做了但沒有固定。我把這個''C:\ Users \ Chicko \ Desktop \ tryout \ jlib \ jrtplib-3.8.2 \ Debug \ jrtplib.lib「 」C:\ Users \ Chicko \ Desktop \ tryout \ jlib \ jthread-1.2。 1個\調試\ jthread.lib「'。這種格式是正確的嗎? – 2011-03-11 15:20:29

+0

你不需要絕對路徑,只需要lib名稱。你把它放在鏈接器的依賴關係中?要查看鏈接到exe的內容,可以在鏈接器命令行中指定/ verbose:lib。這將向您顯示輸出窗口中正在鏈接的所有內容。 – Ralf 2011-03-11 17:10:12

0

我看到回答有點晚,我在Windows上不是很專業(我更喜歡Linux用戶),但是前一天我在Windows上嘗試過JRTPLIB,並且在遇到同樣的問題時我在發佈模式下編譯示例,在調試模式下編譯lib(我看到您使用調試模式)。希望它可以幫助。