View Full Version : Grabber::loadDeviceStateFromFile unresolved symbol.

September 15, 2010, 04:33:45

I have a program in c++ that successfully uses the functions in grabber to capture and display images from my 21bf02 and 04. when I came to add some functionality to save and load settings using loadDeviceStateFromFile I get the compilation error:

1>CameraImageSetup.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __thiscall DShowLib::Grabber::loadDeviceStateFromFile(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &,bool)" (__imp_?loadDeviceStateFromFile@Grabber@DShowLib@@ QAE_NABV?$basic_string@GU?$char_traits@G@std@@V?$a llocator@G@2@@std@@_N@Z) referenced in function "public: virtual int __thiscall CCameraImageSetup::OnInitDialog(void)" (?OnInitDialog@CCameraImageSetup@@UAEHXZ)
1>C:\code\vision\Vision Sorter\Debug\Vision Sorter.exe : fatal error LNK1120: 1 unresolved externals

I have been trying for several hours to include the correct files and libraries, I can see the reference in TIS_UDSHL08_vc9d.lib and have added that to the libraries of the project but it still hasn't changed.

Forgive me if this is a trivial problem, but I am running out of things to try!

Stefan Geissler
September 15, 2010, 08:08:35

Can you please show me the call in the source code? Also you may have a look in the demoapp sample, there is the loadDeviceStateFromFile used.

September 15, 2010, 21:37:28
CString filename("");
filename = _T("\\Program Files\\VisionSorter\\Camera")+ filename;

The code compiles fine, it just fails at the linking stage.

In my demoapp loaddevicestatefromfile isn't used, but loaddevicestate is, on the string that is read out of the registry.

September 15, 2010, 21:52:11
I have the following includes to the Imagining source files:

#include "tisudshl.h"
#include "grabber.h"

with TIS_UDSHL08_vc9d.lib added as an additional dependancy for the project. The TIS_UDSHL08_vc9d.dll file is in the build and run directory.

Stefan Geissler
September 16, 2010, 13:24:09

you may have disabled Treat "wchar_t as builtin type" in your project settings. This must be enabled. Please try this.

September 16, 2010, 20:50:03
Stefan, you sir, are a god.

Stefan Geissler
September 17, 2010, 07:20:31
Well, it was not me, but my programming team.