2

I am having problems with the flycapture SDK (FlyCapture v2.6 Rel 2) on Visual Studio. This is used for BlackFly camera.

I am getting the following errors:

Error   1   error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::Error::Error(void)" (__imp_??0Error@FlyCapture2@@QAE@XZ) 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 &)" (__imp_??0Error@FlyCapture2@@QAE@ABV01@@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)" (__imp_??1Error@FlyCapture2@@UAE@XZ) referenced in function "void __cdecl PrintError(class FlyCapture2::Error)" (?PrintError@@YAXVError@FlyCapture2@@@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 " (__imp_?PrintErrorTrace@Error@FlyCapture2@@UBEXXZ) referenced in function "void __cdecl PrintError(class FlyCapture2::Error)" (?PrintError@@YAXVError@FlyCapture2@@@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)" (__imp_??0BusManager@FlyCapture2@@QAE@XZ) 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)" (__imp_??1BusManager@FlyCapture2@@UAE@XZ) 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 *)" (__imp_?GetNumOfCameras@BusManager@FlyCapture2@@UAE?AVError@2@PAI@Z) 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 *)" (__imp_?GetCameraFromIndex@BusManager@FlyCapture2@@UAE?AVError@2@IPAVPGRGuid@2@@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 *)" (?ValidateFormat7Settings@Camera@FlyCapture2@@UAE?AVError@2@PBUFormat7ImageSettings@2@PA_NPAUFormat7PacketInfo@2@@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)" (?WaitForBufferEvent@Camera@FlyCapture2@@UAE?AVError@2@PAVImage@2@I@Z) 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)" (?WriteRegister@Camera@FlyCapture2@@UAE?AVError@2@II_N@Z)    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)" (?WriteRegisterBlock@Camera@FlyCapture2@@UAE?AVError@2@GIPBII@Z) 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

and to my understanding the problem lies in the directories (include and library).

I have downloaded the FlyCapture SDK v2.6 Release 2 for Windows 32-bit and 64-bit.

In my project I have added the following properties:

Configuration Properties -> Linker -> Additional Library Directories : C:\Program Files\Point Grey Research\FlyCapture2\lib64\FlyCapture2_v100.lib

Configuration Properties -> C/C++ -> Additional Include Directories : C:\Program Files\Point Grey Research\FlyCapture2\include

I have tried to do this with the 32-bit and 64-bit SDK and with different lib's. But I don't know where I have done something wrong. All help is appreciated!!!

4

1 回答 1

6

我一直在努力寻找问题所在,现在我找到了。VS2012 默认不支持 FlyCapture2 SDK。我不得不做出一些改变。

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

  2. 然后我进入安装SDK的文件夹。这里我去了 src\vsprops\VS10 并复制了 FlyCapture2.props 文件。

  3. 然后我重命名了副本,例如“FlyCapture2Changed.props”

  4. 打开“FlyCapture2Changed.props”(记事本、文本编辑器等),找到以下行:

注意!< 和 AdditionalDependencies 之间不应该有空格(与 </ 相同),这里的编辑器有一些问题(文本丢失)。

< AdditionalDependencies>FlyCapture2_$(PlatformToolset).lib;%(AdditionalDependencies)</AdditionalDependencies>

并将其更改为:

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

完成此操作后,我必须对项目进行一些更改。在您的项目下,您应该转到属性管理器并右键单击调试 | Win32 并选择“添加现有属性表”并选择我制作的“FlyCapture2Changed.props”。

完成后,它起作用了!

于 2014-02-20T09:51:54.360 回答