DirectShow在VS2005中编译问题汇总

本文解决了DirectShow示例项目在VS2005中编译时遇到的各种错误,包括缺失类型指定符、未声明的标识符等,并提供了详细的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Error1: error C2146: syntax error : missing ';' before identifier 'PVOID64'

Cause: POINTER_64是一个宏,在64位编译下起作用,它包含在SDK目录下的BASETSD.H中(Microsoft Visual Studio 8/VC/PlatformSDK/Include/basetsd.h(23):#define POINTER_64 __ptr64),但DXSDK自己也带了一个basetsd.h,里面没有定义POINTER_64,从而导致出错。

Solution1:

Projects and Solutions -> VC++ Directories -> Include Files里确保系统包含目录(以S打头的)在最前面,同时在 project properties下面的“C/C++ -> General”中确保“Additional Include Directories”为空(因为它会被优先编译,这样就轮不到VC/PlatformSDK/Include/basetsd.h),所有的包含目录都应该在上面的include里面。这种方法不用改代码。
Solution2:
在DXSDK自己的basetsd.h里自己定义#define POINTER_64 __ptr64
Trackback:http://hi.baidu.com/maxgoto/blog/item/fc40a86e8ec1f3da81cb4aff.html

Solution3(bad):

#define   POINTER_64   __ptr64

typedef   void   *PVOID;   
typedef   
void   *POINTER_64   PVOID64;

 

Error2: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Solution:

// operator=(LONG);

    COARefTime&operator=(LONG);

 

Error3: 1>./outputq.cpp(664) : error C2065: 'iDone' : undeclared identifier

Solution:

   long iDone;

   for (iDone = 0; ....)

 

Error4:

1>./winutil.cpp(2104) : error C2065: 'Count' : undeclared identifier
1>./winutil.cpp(2106) : error C2228: left of '.peRed' must have class/struct/union

Solution:

    UINT Count; // sw 2009.1.27
    for (Count = 0;Count < Result;Count++) {

 

Error5:

1>./wxdebug.cpp(567) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

solution:

/DXSDK/Samples/C++/DirectShow/BaseClasses/wxdebug.cpp
        //static g_dwLastRefresh = 0;
        static DWORD g_dwLastRefresh = 0;

 

Note: When using DXSDK in your applicaiton, remeber to adjust the postion of include files,make sure platformSDK/Include piors to DXSDK/Include.

 

VS2005下编译DirectShow的example时遇到的问题

error LNK2001: unresolved external symbol "unsigned int (__stdcall* ATL::g_pfnGetThreadACP)(void)" (?g_pfnGetThreadACP@ATL@@3P6GIXZA)

solution:  add atls.lib or atlsd.lib to the project.

 

LINK : fatal error LNK1104: cannot open file 'libci.lib'

solution: ignore libcp.lib, libc.lib, and libci.lib

 

LINK : fatal error LNK1104: cannot open file 'largeint.lib'

Solution: remove 'largeintlib'

 

cannot open file '../../common/wmstub.lib'

solution: must instuall Windows Media Format SDK 7.1.1, or just remove it (if the compiling can be successful)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值