Problem creating a DLL in VS8

Hello everyone, I'm using Visual Studio 2005 (VS8) and I am trying to compile some code form OpenCV (cvcam). I did not write this code, but it is open-source and I want to modify it and recompile it. It is designed to create a .lib and a .dll. I believe that I have all the necessary libs. The errors shown below refer to symbols that do exist in strmbasd.lib (which I am including) (verified by a dumpbin on strmbasd.lib). In addition, the libs appear to be created, but the errors come after "pass 1" and seem to be related to the DLL is which is not created.

Below is a sample of last 50 lines, or so, of the compiler output. Again, all of those missing symbols are indeed in strmbasd.lib which is included in the project options (along with its location).




1>Searching libraries
1> Searching C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Samples\Multimedia\DirectShow\BaseClasses\WIN2000_DEBUG\strmbasd.lib:
1> Searching ../../../../lib\highguid.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib\kernel32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\user32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\gdi32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\winspool.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\comdlg32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\advapi32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shell32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\ole32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\oleaut32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib\uuid.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbc32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\odbccp32.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\atlmfc\lib\atlsd.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK\lib\shlwapi.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib\msvcprtd.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib\MSVCRTD.lib:
1> Searching C:\Program Files (x86)\Microsoft Visual Studio 8\VC\lib\OLDNAMES.lib:
1>Finished searching libraries
1>Finished pass 1
1>Generating non-SAFESEH image.
1>Invoking CVTRES.EXE:
1> /machine:x86
1> /verbose
1> /out:"C:\DOCUME~1\begleysm\LOCALS~1\Temp\lnk2EC0.tmp"
1> /readonly
1> "..\..\..\..\_temp\cvcam_dbg.net\cvcam.res"
1> "..\..\..\..\_temp\cvcam_dbg.net\cvcam100d.dll.embed.manifest.res"
1>Microsoft (R) Windows Resource To Object Converter Version 8.00.50727.762
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>adding resource. type:DIALOG, name:103, language:0x0409, flags:0x1030, size:322
1>adding resource. type:MANIFEST, name:2, language:0x0409, flags:0x30, size:2048
1>cvcam.obj : error LNK2001: unresolved external symbol _IID_IBaseFilter
1>cvcamavi.obj : error LNK2019: unresolved external symbol _IID_IBaseFilter referenced in function "public: __thiscall cvcamSourceFile::cvcamSourceFile(char const *,void (__cdecl*)(void *))" (??0cvcamSourceFile@@QAE@PBDP6AXPAX@Z@Z)
1>cvcam.obj : error LNK2001: unresolved external symbol _CLSID_VideoInputDeviceCategory
1>cvcam.obj : error LNK2019: unresolved external symbol "void __stdcall DbgAssert(char const *,char const *,int)" (?DbgAssert@@YGXPBD0H@Z) referenced in function "int __cdecl _cvcamInitVideoSource(struct IBaseFilter * *)" (?_cvcamInitVideoSource@@YAHPAPAUIBaseFilter@@@Z)
1>cvcam.obj : error LNK2001: unresolved external symbol _CLSID_SystemDeviceEnum
1>cvcam.obj : error LNK2001: unresolved external symbol _IID_ICreateDevEnum
1>cvcam.obj : error LNK2019: unresolved external symbol "void __stdcall DeleteMediaType(struct _AMMediaType *)" (?DeleteMediaType@@YGXPAU_AMMediaType@@@Z) referenced in function "void __cdecl _cvcamSummonPinPropPage(int)" (?_cvcamSummonPinPropPage@@YAXH@Z)
1>cvcam.obj : error LNK2001: unresolved external symbol _PIN_CATEGORY_CAPTURE
1>cvcam.obj : error LNK2001: unresolved external symbol _MEDIATYPE_Video
1>cvcam.obj : error LNK2001: unresolved external symbol _IID_IAMStreamConfig
1>cvcam.obj : error LNK2001: unresolved external symbol _CLSID_CaptureGraphBuilder2
1>cvcam.obj : error LNK2001: unresolved external symbol _IID_ICaptureGraphBuilder2
1>cvcam.obj : error LNK2001: unresolved external symbol _CLSID_FilterGraph
1>cvcamavi.obj : error LNK2001: unresolved external symbol _CLSID_FilterGraph
1>cvcam.obj : error LNK2001: unresolved external symbol _IID_IGraphBuilder
1>cvcamavi.obj : error LNK2001: unresolved external symbol _IID_IGraphBuilder
1>cvcam.obj : error LNK2001: unresolved external symbol _IID_IVideoWindow
1>cvcamavi.obj : error LNK2001: unresolved external symbol _IID_IVideoWindow
1>cvcam.obj : error LNK2001: unresolved external symbol _IID_IMediaEventEx
1>cvcamavi.obj : error LNK2019: unresolved external symbol _IID_IMediaEventEx referenced in function "public: bool __thiscall cvcamSourceFile::IsRunning(void)" (?IsRunning@cvcamSourceFile@@QAE_NXZ)
1>cvcam.obj : error LNK2001: unresolved external symbol _IID_IMediaControl
1>cvcamavi.obj : error LNK2001: unresolved external symbol _IID_IMediaControl
1>cvcam.obj : error LNK2019: unresolved external symbol __imp__AMGetErrorTextA@12 referenced in function "int __cdecl _cvcamInitSeveralCams(void)" (?_cvcamInitSeveralCams@@YAHXZ)
1>cvcam.obj : error LNK2001: unresolved external symbol _IID_IBasicVideo
1>cvcamavi.obj : error LNK2001: unresolved external symbol _IID_IBasicVideo
1>cvcamavi.obj : error LNK2001: unresolved external symbol _IID_IMediaSeeking
1>cvcamavi.obj : error LNK2001: unresolved external symbol _TIME_FORMAT_MEDIA_TIME
1>cvcamavi.obj : error LNK2001: unresolved external symbol _TIME_FORMAT_FRAME
1>..\..\..\..\bin\cvcam100d.dll : fatal error LNK1120: 21 unresolved externals
1>Build log was saved at "file://c:\Program Files (x86)\OpenCV\_temp\cvcam_dbg.net\BuildLog.htm"
1>cvcam - 29 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========





Please notice that the strmbasd.lib is searched at the top, then several lines down it says "Finished pass 1", followed by a reference to cvcam100d.dll follow by linking errors.

I am fairly novice when it comes to DLLs. Any help would be appreciated.

Thanks,
Sean
Is it a problem with your lib not being compatible with .NET? Do you need to build an iterop for it?
closed account (z05DSL3A)
I don't know if this would help but it may be worth a look.

http://www.cs.iastate.edu/courses/archive/f06/cs401/labs/lab_04/OpenCV_in_MSVS.txt
Grey Wolf: I looked over that document. All those settings are, if not correct, at least the same as the document hehe. I have a fair bit of experience with openCV and have gotten plenty of my own projects to compile and link and run successfully. This is, however, my 1st foray into recompiling one of the included libs/dlls.

Zaita: To answer your question... I'm not sure. I don't have much experience using .NET. I also don't know what an iterop (interop?) is. A quick Google of interop suggests that they allow modern Visual Studio applications to use COM objects. A quick search of the cvcam project returns only a few references to COM stuff... but it looks like it may use COM objects to access cameras. If this is the problem... how might I go about creating/applying/including an iterop/interop?

Also, it does seem like the lib is compiling/linking while the associated DLL is not. And, as I said, I found the missing symbols in strmbasd.lib. Is it possible that when I recompiled strmbasd.lib (from DirectShow BaseClasses) that I did not compile it in such a way as to make it compatible with .NET? I used nmake... is there an option to modify this?

Again, thanks for the help. I know this is like pulling teeth ;P

Sean
Last edited on
Topic archived. No new replies allowed.