2013-02-10 42 views
0

我需要使用它具有FUNC deviceSetupWithSubtype() (這不是原來的videoInput庫)如何編譯修改videoInput.h

我在rar.h.cpp在最後的修改videoInput庫本頁面: http://opencv.willowgarage.com/wiki/CameraCapture

我試圖與VC2010快遞C++編譯它,我有我的.lib,但是當我把它放在我想用修改後的videoInput.h程序,我得到一個很多LNK錯誤,如:

videoInput.lib(videoInput.obj) :error LNK2001: unresolved external symbol [email protected] 

videoInput.lib(videoInput.obj) :error LNK2001: unresolved external symbol _MEDIASUBTYPE_RGB24 

videoInput.lib(videoInput.obj) :error LNK2001: unresolved external symbol _MEDIASUBTYPE_AYUV 

videoInput.lib(videoInput.obj) :error LNK2001: unresolved external symbol _MEDIASUBTYPE_Y211 

(我也嘗試了正常的videoInput.lib,它運行良好,但它不是我需要的版本)。

我該如何解決這個問題? 或者如果你只是有這個修改videoInput.lib,你可以上傳它? 謝謝。

編輯:

在釋放模式,我得到的也是這個錯誤:

videoInput.lib(videoInput.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' 
+0

你有一個無法解析的外部符號,這意味着你沒有鏈接你應該鏈接的東西。嘗試使用源代碼附帶的makefile構建它。 – StoryTeller 2013-02-10 17:25:16

+0

我沒有makefile的經驗,無論如何我搜索了一些東西,所以我從控制檯做了:nmake -f Makefile.win,但是我得到這個錯誤:makefile.win(24):致命錯誤U1001:語法錯誤:非法字符' {'在macroStop中。 – frank10 2013-02-10 21:25:10

+0

在一個文件夾中有這些文件:makefile.win videoInputLib.a videoInputLib.dev和videoInputLib.layout在另一個文件夾中有videoInput.cpp videoInput.h和videoInput.o – frank10 2013-02-10 21:30:06

回答

1

很多搜​​索上我與許多庫嘗試鏈接錯誤,在結束後,我找到了解決辦法: 必須在videoInput.h添加這些線(在連接最終調整的路徑,我並不需要它):

// if gives error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' 
// insert _ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH in the C++ preprocessor option in the project properties 
// these are the library needed: 
#pragma comment (lib, "oleaut32") 
#pragma comment (lib, "ole32") 
#pragma comment (lib, "user32") 
#pragma comment (lib, "strmbase") 

現在得到的videoInput.lib正確編譯。