2014-02-19 138 views
2

我在Visual Studio上遇到flycapture SDK(FlyCapture v2.6 Rel 2)問題。這用於BlackFly相機。Visual Studio 2012上的FlyCapture SDK問題

我收到以下錯誤:

Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::Error::Error(void)" ([email protected]@@[email protected]) referenced in function _wmain C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::Error::Error(class FlyCapture2::Error const &)" ([email protected]@@[email protected]@@Z) referenced in function _wmain C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 3 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall FlyCapture2::Error::~Error(void)" ([email protected]@@[email protected]) referenced in function "void __cdecl PrintError(class FlyCapture2::Error)" ([email protected]@[email protected]@@@Z) C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 4 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall FlyCapture2::Error::PrintErrorTrace(void)const " ([email protected]@[email protected]@UBEXXZ) referenced in function "void __cdecl PrintError(class FlyCapture2::Error)" ([email protected]@[email protected]@@@Z) C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 5 error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::BusManager::BusManager(void)" ([email protected]@@[email protected]) referenced in function _wmain C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 6 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall FlyCapture2::BusManager::~BusManager(void)" ([email protected]@@[email protected]) referenced in function _wmain C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 7 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual class FlyCapture2::Error __thiscall FlyCapture2::BusManager::GetNumOfCameras(unsigned int *)" ([email protected]@[email protected]@[email protected]@[email protected]) referenced in function _wmain C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 8 error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual class FlyCapture2::Error __thiscall FlyCapture2::BusManager::GetCameraFromIndex(unsigned int,class FlyCapture2::PGRGuid *)" ([email protected]@[email protected]@[email protected]@[email protected]@@Z) referenced in function _wmain C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 66 error LNK2001: unresolved external symbol "public: virtual class FlyCapture2::Error __thiscall FlyCapture2::Camera::ValidateFormat7Settings(struct FlyCapture2::Format7ImageSettings const *,bool *,struct FlyCapture2::Format7PacketInfo *)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@Z) C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 67 error LNK2001: unresolved external symbol "public: virtual class FlyCapture2::Error __thiscall FlyCapture2::Camera::WaitForBufferEvent(class FlyCapture2::Image *,unsigned int)" ([email protected]@[email protected]@[email protected]@[email protected]@[email protected]) C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 68 error LNK2001: unresolved external symbol "public: virtual class FlyCapture2::Error __thiscall FlyCapture2::Camera::WriteRegister(unsigned int,unsigned int,bool)" ([email protected]@[email protected]@[email protected]@[email protected]) C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 69 error LNK2001: unresolved external symbol "public: virtual class FlyCapture2::Error __thiscall FlyCapture2::Camera::WriteRegisterBlock(unsigned short,unsigned int,unsigned int const *,unsigned int)" ([email protected]@[email protected]@[email protected]@[email protected]) C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\BlackFlyMultiTrigger\BlackFlyMultiTrigger.obj BlackFlyMultiTrigger 
Error 70 error LNK1120: 69 unresolved externals C:\Users\dahl2\Documents\Visual Studio 2012\Projects\BlackFlyMultiTrigger\Debug\BlackFlyMultiTrigger.exe BlackFlyMultiTrigger 

和我的理解問題的關鍵在於目錄(和庫)。

我已經下載了適用於Windows的FlyCapture SDK v2.6 Release 2(32位和64位)。

在項目中,我添加了以下屬性:

配置屬性 - >鏈接器 - >附加庫目錄:C:\ Program Files文件\灰點研究\ FlyCapture2 \ lib64的\ FlyCapture2_v100.lib

配置屬性 - > C/C++ - >附加包含目錄:C:\ Program Files文件\灰點研究\ FlyCapture2 \包括

我曾嘗試與32位和64位SDK做到這一點並與d錯誤的庫存。但我不知道我在哪裏做錯了什麼。所有幫助表示讚賞!

回答

6

我一直在努力尋找問題,現在我有。默認情況下,VS2012不支持FlyCapture2 SDK。我不得不做出一些改變。

  1. 首先,我添加了屬性(如上所述),但使用了32位SDK。

  2. 然後我進入了安裝SDK的文件夾。在這裏,我去了src \ vsprops \ VS10並創建了FlyCapture2.props文件的副本。

  3. 然後我改名爲副本,例如 「FlyCapture2Changed.props」

  4. 打開 「FlyCapture2Changed.props」(記事本,文本編輯器等),並發現該行:

NB! <和AdditionalDependencies之間不應該有空格(與< /相同),但在編輯器中遇到了一些問題(文本丟失)。

< AdditionalDependencies> FlyCapture2 _ $(PlatformToolset)的.lib;%(AdditionalDependencies)</AdditionalDependencies>

,並將其變更爲:

< AdditionalDependencies> FlyCapture2_v100.lib;%(AdditionalDependencies)</AdditionalDependencies >

完成這個工作後,我不得不對項目做一些改變。在你的項目下,你應該去物業經理,然後右擊Debug | Win32並選擇「添加現有屬性表」並選擇我已經制作的「FlyCapture2Changed.props」。

完成這個工作後,它的工作!

+0

哇,非常感謝!我一直在尋找兩天,這終於解決了我的問題。 –