peterdemin
peterdemin

Reputation: 526

VC++ Building directshow baseclasses

I am a newbie to DirectX SDK, Platfrom SDK and DirectShow. I downloaded latest Platform SDK and DirectX SDK August'09. I tried to build sample project in folder:

Microsoft Platform SDK\Samples\Multimedia\DirectShow\Capture\PlayCap\  

And had following building errors:

LINK : fatal error LNK1181: cannot open input file 'D:\Program Files\
Microsoft Platform SDK\samples\multimedia\directshow\baseclasses\
WIN2000_DEBUG\strmbasd.lib'

As far, as I understand, I need to build all sources in "Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\" directory to get necessary lib.
I tried nmake in that dir and got following:

D:\Program Files\Microsoft Platform SDK\Samples\Multimedia\DirectShow\
BaseClasses\ctlutil.h(278) : error C4430: missing type specifier - int
assumed. Note: C++ does not support default-int.

Here is code on that lines:

278: STDMETHODIMP
279: CMediaEvent::NonDelegatingQueryInterface(REFIID riid, void **ppv)

What I do wrong? Just can't believe, that using Microsoft's libraries must be so hard.

Upvotes: 4

Views: 7465

Answers (3)

rogerdpack
rogerdpack

Reputation: 66711

For me this error meant "open C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\baseclasses.sln" (in my case, in visual studio express 2010) it asks to convert it, do so, then build both "release" and "debug."

Then in your own project, under project settings for your project

example: add G:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses to beginning of “VC++ directories” include path, and G:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\debug to your lib path (anywhere in that).

See also https://msdn.microsoft.com/en-us/library/windows/desktop/dd407279(v=vs.85).aspx

Upvotes: 0

execNext
execNext

Reputation: 363

On my Xp64 box, I managed to get the DirectShow baseclasses libs built in order to run the amcap sample. I have the June 2010 Microsoft DirectX SDK installed as well as the Microsoft Windows SDK for Windows 7 (7.1) with all the C/C++ compilers.

First, we have to compile the DirectShow baseclasses :

open a regular old cmd.exe

cd C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses

If you're getting an error about not have VCBuild.exe installed, it's because the sln and various project files (eg: C/C++ vcproj) are ancient, the next command will upgrade them nicely, changing old stanky vcproj files into new crappy vcxproj files VCUpgrade is here on my machine :

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\vcupgrade.exe

Note that even after trying the various combinations of params to vcupgrade, building the sln with msbuild is a no-go (docs be danged), so I had to directly compile the project I left the batch file var named SLN anyway because I'm a real revolutionary

VCUpgrade -nologo -overwrite baseclasses.vcproj

This makes it a touch easier to compile different configurations

set SLN="baseclasses.vcxproj"

Note that the baseclasses Release build makes strmbase.lib and Debug makes strmbasd.lib amcap needs the Release build tho amcap's build can be debug

A) Compile Release Win32 (== x86)

Using the MsSdk's SetEnv.Cmd lets you avoid all that vsvars32.bat quagmire as well as the 8 million different cmd shells that have been specially designed to be one or two fatal flaws away from actually working while relying upon an eplipsy-inducing web of batch files to do they thing (hey! maybe the two are related!?)

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /release /x86 /xp

I've not had any luck using the 64-bit version of MSBuild (maybe targets?), but x86 MSBuild has been working no problem

"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" %SLN% /p:Configuration=Release /p:Platform=Win32

B) Compile Release X64

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /release /x64 /2003

"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" %SLN% /p:Configuration=Release /p:Platform=X64

Second, we can now compile both versions of amcap

open a regular old cmd.exe

cd C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\capture\amcap

VCUpgrade the vcproj to a vcxproj

VCUpgrade -nologo -overwrite amcap.vcproj

set SLN="amcap.vcxproj"

A) Compile Debug Win32 (== x86)

Set compiler,lib,include,... paths and then compile

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /debug /x86 /xp

"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" %SLN% /p:Configuration=Debug /p:Platform=Win32

B) Compile Debug X64

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /debug /x64 /2003

"C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" %SLN% /p:Configuration=Debug /p:Platform=X64

I used SysInternals *Process Explorer* to verify that each exe was actually 32-bit and 64-bit respectively. It seems inexplicable that most developers I've worked with don't even know about Process Explorer -- I'm in that thing all day. And yes, that is what she said.

Upvotes: 1

Cristian Adam
Cristian Adam

Reputation: 4844

Microsoft has renamed Platfrom SDK to Windows SDK. The lastest Windows SDK is Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1.

Windows SDK for Windows 7 has Visual Studio 2008 2005 project files for all DirectShow projects.

Upvotes: 3

Related Questions