使用Visual Studio.net 2005 编译 Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses 的问题
2008-06-10 11:06
651 查看
使用Visual Studio.net 2005 编译 Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses 的时候,
使用nmake ,
总是会出现一些编译过去的怪问题,
如:
环境:winxp SP2, Visual studio 8.0.5..., with .net framework 2.0.50727, Microsoft DirectX SDK (August 2007), and Microsoft Platform SDK (5.2.3790.1830.15.PlatformSDK_Svr2003SP1_rtm)
c:\Programme\Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.h(278) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
in ctlutil.h
private:
// Prevent bugs from constructing from LONG (which gets
// converted to double and then multiplied by 10000000
COARefTime(LONG);
operator=(LONG);
};
c:\Programme\Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.h(278) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<- the line 278 referes to " operator=(LONG);"
================================================
on ctlutil.h, but I get another error C4430 in wxdebug.cpp
.\wxdebug.cpp(564) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
the line is: static g_dwLastRefresh = 0;
I have no ideia which type g_dwLastRefresh should be.
the code block is as follows:
BOOL WINAPI DbgCheckModuleLevel(DWORD Type,DWORD Level)
{
if(g_fAutoRefreshLevels)
{
// re-read the registry every second. We cannot use RegNotify() to
// notice registry changes because it's not available on win9x.
static g_dwLastRefresh = 0;
DWORD dwTime = timeGetTime();
if(dwTime - g_dwLastRefresh > 1000) {
g_dwLastRefresh = dwTime;
// there's a race condition: multiple threads could update the
// values. plus read and write not synchronized. no harm
// though.
DbgInitModuleSettings(false);
}
}
and on winutil.cpp
.\winutil.cpp(2104) : error C2065: 'Count' : undeclared identifier
code block:
"
// And likewise compare against the last ten entries
Result = GetSystemPaletteEntries(hdc,PalHiStart,PalLoCount,SystemEntries);
for (Count = 0;Count < Result;Count++) {
========================================
改正方法:
I had to change the code provided with platform SDK.
First the ctlutil.h from "operator=(LONG);" to "COARefTime& operator=(LONG);"
This solves one error and brings out 10 more.
Then wxdebug.cpp
from "static g_dwLastRefresh = 0;" to "static int g_dwLastRefresh = 0;"
Compile again and change in winutil.cpp
"for (Count = PalLoCount;INT(Count) < min(PalHiStart,iColours);Count++) {" to "for (int Count = PalLoCount;INT(Count) < min(PalHiStart,iColours);Count++) {"
in outputq.cpp add the line
long iDone = 0; just before the "
for (iDone = 0;
iDone < nSamples || (m_nBatched != 0 && m_bSendAnyway);"
使用nmake ,
总是会出现一些编译过去的怪问题,
如:
环境:winxp SP2, Visual studio 8.0.5..., with .net framework 2.0.50727, Microsoft DirectX SDK (August 2007), and Microsoft Platform SDK (5.2.3790.1830.15.PlatformSDK_Svr2003SP1_rtm)
c:\Programme\Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.h(278) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
in ctlutil.h
private:
// Prevent bugs from constructing from LONG (which gets
// converted to double and then multiplied by 10000000
COARefTime(LONG);
operator=(LONG);
};
c:\Programme\Microsoft Platform SDK\Samples\Multimedia\DirectShow\BaseClasses\ctlutil.h(278) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
<- the line 278 referes to " operator=(LONG);"
================================================
on ctlutil.h, but I get another error C4430 in wxdebug.cpp
.\wxdebug.cpp(564) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
the line is: static g_dwLastRefresh = 0;
I have no ideia which type g_dwLastRefresh should be.
the code block is as follows:
BOOL WINAPI DbgCheckModuleLevel(DWORD Type,DWORD Level)
{
if(g_fAutoRefreshLevels)
{
// re-read the registry every second. We cannot use RegNotify() to
// notice registry changes because it's not available on win9x.
static g_dwLastRefresh = 0;
DWORD dwTime = timeGetTime();
if(dwTime - g_dwLastRefresh > 1000) {
g_dwLastRefresh = dwTime;
// there's a race condition: multiple threads could update the
// values. plus read and write not synchronized. no harm
// though.
DbgInitModuleSettings(false);
}
}
and on winutil.cpp
.\winutil.cpp(2104) : error C2065: 'Count' : undeclared identifier
code block:
"
// And likewise compare against the last ten entries
Result = GetSystemPaletteEntries(hdc,PalHiStart,PalLoCount,SystemEntries);
for (Count = 0;Count < Result;Count++) {
========================================
改正方法:
I had to change the code provided with platform SDK.
First the ctlutil.h from "operator=(LONG);" to "COARefTime& operator=(LONG);"
This solves one error and brings out 10 more.
Then wxdebug.cpp
from "static g_dwLastRefresh = 0;" to "static int g_dwLastRefresh = 0;"
Compile again and change in winutil.cpp
"for (Count = PalLoCount;INT(Count) < min(PalHiStart,iColours);Count++) {" to "for (int Count = PalLoCount;INT(Count) < min(PalHiStart,iColours);Count++) {"
in outputq.cpp add the line
long iDone = 0; just before the "
for (iDone = 0;
iDone < nSamples || (m_nBatched != 0 && m_bSendAnyway);"
相关文章推荐
- 转帖:使用 Microsoft Visual Studio 2005 时可能遇到的问题
- [转载] wxWidgets-2.6.2 + Microsoft Visual C++ 2005 Express + Platform SDK 安装使用手记
- Microsoft Visual Studio 2005中使用水晶报表 winform c# asp.net水晶报表
- 使用directshow时Baseclasses的编译问题
- wxWidgets-2.6.2 + Microsoft Visual C++ 2005 Express + Platform SDK 安装使用手记
- Visual Studio .net 2003 & 2005安装问题
- 【vc++ 2010问题】使用visual c++/studio 2010编译程序后,出现_CrtIsValidHeapPointer(pUserData)错误
- 关于安装 DirectX SDk Dec 2005 后无法编译DirectShow应用程序的问题
- asp.net 新手资源教程《Total Training Visual Studio 2005 教程》[Microsoft Visual Studio 2005 Productivity with .NET Framework 2.0]【ISO】
- Microsoft Visual Studio 2005中使用水晶报表(收藏)
- VS2008 编译 DirectX SDK BaseClasses 时的问题
- 【转载】使用ObjectARX 2005+Visual Studio.NET 2003创建ARX程序
- 使用 Microsoft Visual Studio 2005 开发备忘(作者:海雅)
- Microsoft Visual Studio .NET 2005 编写自己的ActiveX
- Microsoft Visual Studio 2005中使用水晶报表
- 使用Microsoft® .NET Framework 3.0 and Visual Studio® 2005开发的免费课程
- Microsoft Visual SourceSafe 2005在VS.NET中的使用
- [VB.NET]Microsoft Visual Studio .NET 2003怎么升级到2005
- Visual Studio.NET 2005使用心得一命名空间的简化导入
- Microsoft Visual Studio 2005中使用水晶报表