views:

46

answers:

3

Hi,

I have some simple code using Point Gray's FlyCapture libraries:

#include <iostream>
#include "FlyCapture2.h"

using namespace std;

int main(){
    cout << "Hello World!";
    FlyCapture2::BusManager m;
    return 0;
}

The above code gives these link error at compile time:

1>------ Build started: Project: CJMVideo, Configuration: Release Win32 ------
1>Compiling...
1>CJMVideo.cpp
1>Linking...
1>CJMVideo.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall FlyCapture2::BusManager::~BusManager(void)" (__imp_??1BusManager@FlyCapture2@@UAE@XZ)
1>CJMVideo.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall FlyCapture2::BusManager::BusManager(void)" (__imp_??0BusManager@FlyCapture2@@QAE@XZ)
1>C:\Users\Akihiro\Documents\Visual Studio 2008\Projects\CJMVideo\Release\CJMVideo.exe : fatal error LNK1120: 2 unresolved externals
1>Build log was saved at "file://c:\Users\Akihiro\Documents\Visual Studio 2008\Projects\CJMVideo\CJMVideo\Release\BuildLog.htm"
1>CJMVideo - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I have added FlyCapture's directory as a library directory in VS2008's options, and I have added the libraries as additional dependencies under project settings.

What is my next step to debug? I am at a loss.

Thanks,

A: 

Bump.

I have the same issue. Been googling this all day but only found this thread with the same problem.

Windows 7 Visual Studio 2008 Tried both flycapture2.1.1.1_x86.exe and flycapture2.1.1.1_x64.exe

I've added the path to the library as well as the library name to the linker, under project settings.

Error: 2>Linking... 2>wanseye.lib(PSEye.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual _thiscall FlyCapture2::Error::~Error(void)" (_imp_??1Error@FlyCapture2@@UAE@XZ) 2>wanseye.lib(PSEye.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: _thiscall FlyCapture2::Error::Error(void)" (_imp_??0Error@FlyCapture2@@QAE@XZ) 2>J:\Desktop\WansEye\wanseye_tester\Release\wanseye_tester.exe : fatal error LNK1120: 2 unresolved externals

surgio
A: 

@Surgio:

I solved my problem, so I thought I'd give you an update. My issue turned out to be that my Visual Studio was using a 32 bit compiler but trying to compile from 64 bit libraries.

You probably did this, but just case, make sure you (1) added the libraries locations in VS and (2) make sure you added the libraries as additional dependencies under your project settings.

A: 

I think I've got it, and I just saw your reply.. haha.

I was trying to link my 32 bit app with the 64 bit flycapture library. I suspected this was the case initially when I saw the lib path was lib64. However, running the 32 bit sdk installer still gave me the lib64 path, so I linked to the library in there anyway.

I'm running Windows 7 64 bit at work so perhaps the 32 bit installer assumes I actually wanted the 64 bit libraries?

I ran the same 32 bit flycapture sdk installer on a vista 32 bit at home and it gave me the 32 bit libraries (../lib/ not ../lib64/), and my code links and compiles fine to the flycapture library.

surgio