怎么在vc中编译directshow的例子..

htwoo 2001-02-14 09:09:00
那种,只有makefile文件的怎么做阿...
...全文
101 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhq2000 2001-02-15
  • 打赏
  • 举报
回复
直接在VC中用AppWizard建立基于MFC或Windows Application的程序.


Setting Up the Build Environment
[This is preliminary documentation and subject to change.]

This article describes how to build Microsoft® DirectShow® applications and filters. You can build a project from the command line, or from within the Microsoft® Visual Studio® environment that comes with Microsoft® Visual C++®. This article assumes that you are using either Visual Studio 6.0 or the CL.EXE command-line tool. If you are using a different build environment, you'll need to consult the documentation provided with it.

Setting the Include and Lib Directories
Setting the Compiler and Linker Options
Building Filters
Setting the Include and Lib Directories
By default, the Include and Lib directories are installed in the following locations:

Include Directories: Dxmedia\Include, Dxmedia\Classes\Base

Library Directory: Dxmedia\Lib

These directories must appear first in their respective search paths.

In Visual Studio:

1.From the Tools menu, choose Options.
2.Choose the Directories tab.
3.In the Show directories for drop-down list, select Include files.
4.Add the directories to the list.
5.Drag them to the top of the list.
6.Repeat steps 3–5 with the Library files drop-down list.

Setting the Compiler and Linker Options
Set the following options for compiling and linking.

MFC Libraries
Preprocessor Definitions
Compiler Options
Linking
MFC Libraries
If your project is based on the Microsoft Foundation Classes (MFC), include the MFC headers and libraries. Otherwise, omit them.

In Visual Studio:

1.Choose Settings from the Project menu.
2.Choose the General tab.
3.In the Microsoft Foundation Classes drop-down list, select the appropriate item.

Preprocessor Definitions
Use the following preprocessor definitions:

Preprocessor Definition Description
INC_OLE2 : Includes the ole2.h header file, which provides OLE functions.
_DEBUG Selects the debug versions of the run-time routines. (Include in debug builds.)
_DLL : Selects the DLL versions of the run-time routines. (Include if you are building a filter as a DLL.)
_MT : Selects the multithread versions of the run-time routines.
STRICT : Enables strict type checking. (Recommended.)
_X86_=1 : Creates Intel®-compatible executables.
WIN32 : Defines certain types specific to Microsoft® Win32® applications.

Also, depending on the target platform, set the appropriate WINVER and _WIN32_WINNT definitions:

Target Platform Preprocessor Definitions
Microsoft® Windows® 98 and Windows 2000 WINVER=0x0500
Windows 2000 _WIN32_WINNT=0x0500 and WINVER=0x0500

For more information on specifying the target platform, see the "Header File Conventions" topic in the Platform SDK.

In Visual Studio:

1.Choose Settings from the Project menu.
2.Choose the C/C++ tab.
3.Add the preprocessor definitions to the Preprocessor Definitions text area.

Compiler Options
Use the following compiler options:

Description Command-Line Option
Enable exception handling. /Gx
Blend optimatizations for Pentium processors. /GB
Use the __stdcall calling convention. /Gz
Select the run-time library (multithreaded, multithreaded DLL, debug multithreaded, debug multithreaded DLL). /MT, /MD, /MTd, or /MDd
Do not use precompiled headers. Omit the /Fp, /Yc, /Yu, or /YX options.

In Visual Studio:

1.Choose Settings from the Project menu.
2.Choose the C/C++ tab.
3.Choose the C++ Language category.
4.Select the Enable exception handling check box.
5.Choose the Code Generation category.
6.In the Processor drop-down list, select Blend*.
7.In the Calling convention drop-down list, select _stdcall.
8.In the Use Run-time library drop-down list, select the appropriate item.

Choose the Precompiled Headers category.
Select the Not using precompiled headers option button.
Linking
Link using the following libraries:

Retail builds: Quartz.lib, Strmbase.lib, Msvcrt.lib
Debug builds: Quartz.lib, Strmbasd.lib, Msvcrtd.lib
Ignore all default libraries; use the /NODEFAULTLIB linker option.

In Visual Studio:

1.Choose Settings from the Project menu.
2.Choose the Link tab.
3.Add the library names to the beginning of the Object/Library modules text box.
4.Select the Ignore all default libraries check box.

Building Filters
If you build a filter, you must perform the following steps in addition to the ones described in the previous sections.

If you implement the filter as a DLL, include a definition (.def) file that exports the DLL functions. The following is an example of a definition file. The filter's output file is assumed to be Filter.ax.

LIBRARY FILTER.AX
DESCRIPTION 'Description of my filter'
PROTMODE
EXPORTS
DllGetClassObject
DllCanUnloadNow
DllRegisterServer
DllUnregisterServer

Set the base address to 0x1c400000 and the entry-point symbol to DllEntryPoint@12.

In Visual Studio:

1.Choose Settings from the Project menu.
2.Choose the Link tab.
3.Select the Output category.
4.Type 0x1c400000 in the Base address text box.
5.Type DllEntryPoint@12 in the Entry-point symbol text box.

16,551

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧