Connecting Tech Pros Worldwide Help | Site Map

Differences between CLI command line and CLI control lib project!?

Achim Domma
Guest
 
Posts: n/a
#1: Sep 9 '06
Hi,

I try to implement a control library in CLI/C++ which uses DirectShow. I
have these lines in my code, which should make it possible to use
DirectShow:

#include <initguid.h>
#include <dshow.h>
#pragma comment (lib, "strmiids.lib")
#pragma comment (lib, "Quartz.lib")
#pragma comment (lib, "ole32.lib")

In a command line CLI project, I can compile the "How to Play a File"
example from this url:

http://windowssdk.msdn.microsoft.com.../ms783787.aspx

If I use the same code in my CLI control library project, I get the
following error:

error LNK2001: unresolved external symbol IID_IGraphBuilder

Any hint what might be the difference?

regards,
Achim
Bruno van Dooren [MVP VC++]
Guest
 
Posts: n/a
#2: Sep 10 '06

re: Differences between CLI command line and CLI control lib project!?


I try to implement a control library in CLI/C++ which uses DirectShow. I
Quote:
have these lines in my code, which should make it possible to use
DirectShow:
>
#include <initguid.h>
#include <dshow.h>
#pragma comment (lib, "strmiids.lib")
#pragma comment (lib, "Quartz.lib")
#pragma comment (lib, "ole32.lib")
>
In a command line CLI project, I can compile the "How to Play a File"
example from this url:
>
http://windowssdk.msdn.microsoft.com.../ms783787.aspx
>
If I use the same code in my CLI control library project, I get the
following error:
>
error LNK2001: unresolved external symbol IID_IGraphBuilder
Did you perhaps accidentally forget to include the appropriate header that
defines that IID?
Another likely cause of that problem is explained here:
http://vcfaq.mvps.org/com/13.htm

--

Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"


Achim Domma
Guest
 
Posts: n/a
#3: Sep 10 '06

re: Differences between CLI command line and CLI control lib project!?


Bruno van Dooren [MVP VC++] wrote:
Quote:
Quote:
>error LNK2001: unresolved external symbol IID_IGraphBuilder
>
Did you perhaps accidentally forget to include the appropriate header that
defines that IID?
Another likely cause of that problem is explained here:
http://vcfaq.mvps.org/com/13.htm
I solved the problem: The library is per default compiled with /clr:pure
and the default for the executable ist /clr. If I compile the library
with /clr too, it work's fine so far.

Could somebody explain this behavior?

Achim
Ben Voigt
Guest
 
Posts: n/a
#4: Sep 11 '06

re: Differences between CLI command line and CLI control lib project!?



"Achim Domma" <domma@procoders.netwrote in message
news:4503ee10$0$18488$9b4e6d93@newsspool3.arcor-online.net...
Quote:
Bruno van Dooren [MVP VC++] wrote:
>
Quote:
Quote:
>>error LNK2001: unresolved external symbol IID_IGraphBuilder
>>
>Did you perhaps accidentally forget to include the appropriate header
>that defines that IID?
>Another likely cause of that problem is explained here:
>http://vcfaq.mvps.org/com/13.htm
>
I solved the problem: The library is per default compiled with /clr:pure
and the default for the executable ist /clr. If I compile the library with
/clr too, it work's fine so far.
>
Could somebody explain this behavior?
I suppose you are also using this interface directly from your executable.
When a native type is compiled in managed code, the assembly name becomes
part of the type's identity, so IID_IGraphBuilder in the assembly is
incompatible and can't satisfy a reference for IID_IGraphBuilder in the main
exe. When you compile in mixed mode, UUID becomes a native type, the normal
C++ rules apply.
Quote:
>
Achim

Closed Thread