PDA

View Full Version : Unresolved external symbol "DShowLib::InitLibrary"



Matt Casey
December 16, 2004, 21:46:52
Greetings,
I'm trying to take my code that seeminly worked with the 1.41 version of the IC Imaging Classes and move it to version 2.1. When I try to link, I get the following error (Visual Studio .NET 2003, C++):

CameraImage.lib(isCamera.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) bool __cdecl DShowLib::InitLibrary(char const *)" (__imp_?InitLibrary@DShowLib@@YA_NPBD@Z) referenced in function "private: void __thiscall ISCamera::InitializeCamera(class ImageParameters &,float,bool)" (?InitializeCamera@ISCamera@@AAEXAAVImageParameter s@@M_N@Z)

The relevant code is just:


if( ! DShowLib::InitLibrary( "XYZ" ) )
{
THROW_EXCEPTION( "Unable to initialized DShow Library.\n");
}


This is the only linking error I get when I try to build the project, and I'm able to build the example projects without any problem. Is there something else I should be doing? I looked at the samples and can't find the difference.

An unrelated question: is there an easy way I can make it so that whenever I create a new project that uses IC, I don't need to copy TIS_UDSHL06_vc71.dll to the directory containing the executable?

Many thanks,
Matt

Stefan Geissler
December 17, 2004, 08:19:50
Matt,

You forgot to add the matching library to your project.

Add the TIS_UDSHL06_vc71d.lib to the debug link section and the TIS_UDSHL06_vc71.lib to the release link section.


An unrelated question: is there an easy way I can make it so that whenever I create a new project that uses IC, I don't need to copy TIS_UDSHL06_vc71.dll to the directory containing the executable?

Yes, you can. Just change the output directory of your project executable to your IC Imaging Control's installation directory with the subdirectory “classlib\debug” for the debug version and “classlib\release” for the release version. If you mix debug and release, you will get an error in the function CRTIsValidHeapPointer().
Also the the working directory for the debug session to the pathes mentioned above.

See also the documentation at:
http://www.imagingcontrol.com/ic/docs/html/class/ProjectSettings_VC71.htm

The same documentation resides on your computer. Just click the Start button, select “All Programs” and then “IC Imaging Control n.n”. It is the “Classlibraries User's Guide” help file.

Matt Casey
December 17, 2004, 21:03:52
I double checked, and I am linking to TIS_UDSHL06_vc71d.lib and TIS_UDSHL06_vc71.lib (for debug and release, respectively) in addition to strmiids.lib. If I had forgotten to link to these, I would get 47 linking errors, but right now I'm just getting this one. That's why I'm so confused by this... only one thing seems broken, and it's on a fresh IC2.1 installation. Very odd.

Matt

Stefan Geissler
December 20, 2004, 08:49:34
If you have not included the tisudshl.h file, please send your project zipped to support@imagingcontrol.com, so i can have a look on it.