VC++构建 directshow 基类

发布于 2024-08-16 17:23:27 字数 940 浏览 1 评论 0原文

我是 DirectX SDK、Platfrom SDK 和 DirectShow 的新手。我下载了最新的 Platform SDK 和 DirectX SDK August'09。我尝试在文件夹中构建示例项目:

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

并出现以下构建错误:

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

据我所知,我需要在“Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\”目录中构建所有源以获得必要的库。< br> 我在该目录中尝试了 nmake 并得到以下结果:

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.

这是该行的代码:

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

我做错了什么?简直不敢相信,使用微软的库竟然这么难。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

动次打次papapa 2024-08-23 17:23:27

Microsoft 已将 Platfrom SDK 重命名为 Windows SDK。最新的 Windows SDK 是 Microsoft适用于 Windows 7 和 .NET Framework 3.5 SP1 的 Windows SDK

Windows SDK for Windows 7 具有适用于所有 DirectShow 项目的 Visual Studio 2008 2005 项目文件。

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.

傾旎 2024-08-23 17:23:27

在我的 Xp64 机器上,我设法构建了 DirectShow 基类库,以便运行 amcap 示例。我安装了 2010 年 6 月的 Microsoft DirectX SDK 以及适用于 Windows 7 (7.1) 的 Microsoft Windows SDK 以及所有 C/C++ 编译器。

首先,我们必须编译 DirectShow 基类:

打开常规的旧 cmd.exe

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

如果您收到有关未安装 VCBuild.exe 的错误,这是因为
sln 和各种项目文件(例如:C/C++ vcproj)很古老,下一个命令将
很好地升级它们,将旧的劣质 vcproj 文件更改为新的蹩脚 vcxproj 文件
VCUpgrade 在我的机器上:

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

请注意,即使在尝试了 vcupgrade 的各种参数组合之后,
使用 msbuild 构建 sln 是不行的(文档有问题),所以我必须直接
编译项目 无论如何,我留下了名为 SLN 的批处理文件 var,因为我是一个真正的革命者

VCUpgrade -nologo -overwrite baseclasses.vcproj

这使得编译不同的配置变得更加容易

set SLN="baseclasses.vcxproj"

请注意,基类 Release 构建使得 strmbase.lib< /强>
并且调试生成strmbasd.lib
amcap 需要 Release 版本,但 amcap 的版本可以调试

A) 编译 Release Win32 (== x86)

使用 MsSdk 的 SetEnv.Cmd 可以让您也避免所有 vsvars32.bat 泥潭
作为 800 万个不同的 cmd shell,它们被专门设计为一个
或在依赖诱发癫痫的网络时远离实际工作的两个致命缺陷
批处理文件来完成他们的事情(嘿!也许这两个是相关的!?)

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

我没有使用 64 位版本的 MSBuild (也许是目标?),
但是 x86 MSBuild 一直工作没有问题

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

B) 编译 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

其次,我们现在可以编译两个版本的 amcap

打开常规的旧 >cmd.exe

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

VCUpgradevcproj 升级为vcxproj

VCUpgrade -nologo -overwrite amcap.vcproj

set SLN="amcap.vcxproj"

A) 编译调试Win32 (== x86)

设置编译器、lib、include...路径,然后编译

"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) 编译调试 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

我使用 SysInternals *Process Explorer* 来验证每个 exe 实际上分别是 32 位和 64 位。与我共事过的大多数开发人员甚至不知道 Process Explorer ,这似乎令人费解——我整天都在做这件事。是的,她就是这么说的。

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.

从来不烧饼 2024-08-23 17:23:27

对我来说,这个错误意味着“open C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\baseclasses.sln”(在我的例子中,在 Visual Studio Express 2010 中)它要求将其转换,这样做,然后构建“发布”和“调试”。

然后在您自己的项目中,在项目

示例的项目设置下:添加
G:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses
到“VC++ 目录”开头的包含路径,以及 G:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\baseclasses\debug 到您的 lib 路径(该路径中的任何位置) )。

另请参阅 https://msdn。 microsoft.com/en-us/library/windows/desktop/dd407279(v=vs.85).aspx

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文