如何使用 gnu make 开发(甚至开始使用)MS DirectShow 应用程序?
我试图使用 gnu make 而不是从 Visual Studio/nmake 中构建 DirectShow BaseClasses (在 C:\DXSDK\Samples\C++\DirectShow\BaseClasses 等目录中),但我没有运气。可以在此处下载该 SDK。
如果您熟悉使用 gnu make 工具开发 Microsoft DirectShow 应用程序(特别是构建基类),而不是使用 Microsoft 交给您的繁琐设备,请提供帮助!
编辑:我最终放弃了使用任何“非MS”方式在MS的框架下进行开发。
I was trying to build the DirectShow BaseClasses (in directory like C:\DXSDK\Samples\C++\DirectShow\BaseClasses) with gnu make instead of from within Visual Studio/nmake, but I had no luck. The SDK can be downloaded here.
This is a similar question, but the answer is targeted to the VS environment.
If you're familiar with developing Microsoft DirectShow applications (in particular, building the baseclasses) using the gnu make tool, instead of the cumbersome apparatus Microsoft hands to your table, please help!
EDIT: I finally gave up using any "non-MS" way to develop under MS' framework.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道为什么你认为微软的工具很麻烦。命令行和 Visual Studio 工具对于我过去构建 strmbase.lib 都非常有用。事实上,我似乎记得只需安装 Windows SDK,导航到 DShow 库并输入“build”即可完成。
要使用自定义构建环境编译 strmbase.lib:
只需创建一个 Makefile,就像从源代码创建任何其他代码库 (.lif) 一样。使用指向 Windows SDK 目录的包含路径单独编译所有 .cpp 文件。 (即包含头文件的目录)。然后将编译后的源文件中的所有目标文件打包到库存档中。
可选:对于调试构建,只需确保 _DEBUG 和 DEBUG 都是通过 Makefile 定义的。 (避免定义其中一个而未定义另一个的情况)。 Streams.h 顶部的一些逻辑会为您处理这个问题。
可选:如果您想要 unicode 字符串,您应该通过 Makefile 定义 _UNICODE 和 UNICODE (同样的事情 - 避免定义一个但没有定义另一个的情况)。如果您的 Makefile 中没有定义任何一个,则不必担心这一步。
另外,如果我记得的话,其中一个文件存在一些与 ATL 中的定义冲突的问题。如果你碰到了这个问题,就很容易修复。
我不确定您认为的另一个 lib 文件是什么。也许是strmiids.lib?如果 Windows SDK 库路径中还没有该文件,则可以使用某些 INITGUID 定义轻松生成它。
I'm not sure why you think the Microsoft tools are cumbersome. Both the command line and Visual Studio tools work great for me for building strmbase.lib in the past. As a matter of fact, I seem to recall just installin the Windows SDK, navigating to the DShow library and typing "build" to get it made.
To compile strmbase.lib with a custom build environment:
Just create a Makefile like you would any other code library (.lif) from sources. Individually compile all the .cpp files with an include path that points to the Windows SDK directory. (i.e. the directory that contains header file). Then package all the object files from the compiled source files into a library archive.
Optional: For a debug build, just make sure both _DEBUG and DEBUG are defined via your Makefile. (Avoid the case where one is defined, but not the other). Some logic at the top of streams.h handles this for you.
Optional: If you want unicode strings, you should define both _UNICODE and UNICODE via your Makefile (same thing - avoid the case where one is defined but not the other). If you don't have either defined in your Makefile, you don't have to worry abou this step.
Also, if I recall, there's some issue with one of the files that conflicts with a define in ATL. If you hit that, it's easy to fix.
I'm not sure what the other lib file is that you think. Perhaps strmiids.lib? If you don't already have that in the Windows SDK lib path, it's easy to generate that with some INITGUID defines.