|
就是一个播放歌曲的源文件 play.cpp,文件扩展名是.cpp时编译通过并程序执行正常,可是为什么把扩展名改成.c后编译就出一大堆错?
[复制链接]
开发环境是EVC4.O。
就是一个播放歌曲的源文件 play.cpp,文件扩展名是.cpp时编译通过并程序执行正常,可是为什么把扩展名改成.c后编译就出一大堆错?
play.c 文件:
#include
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
IGraphBuilder *pGraph = NULL;
IMediaControl *pMediaControl = NULL;
TCHAR* p;
TCHAR szFilePath[MAX_PATH + 1];
GetModuleFileName(NULL, szFilePath, MAX_PATH);
p = wcsrchr(szFilePath, _T('\\'));
*p = 0;
wcscpy(p, TEXT("\\xsfyz.mp3"));
CoInitialize(NULL);
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC,
IID_IGraphBuilder, (void **)&pGraph);
// Query for IMediaControl (not shown)
// Filenames on Windows CE start with a \\ instead of a drive letter.
if(NULL == pGraph)
{
MessageBox(NULL, L"NULL == pGraph", L"NULL == pGraph", MB_OK);
return 0 ;
}
pGraph->RenderFile(szFilePath, NULL);
pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
if(NULL == pMediaControl)
{
pGraph->Release();
MessageBox(NULL, L"NULL == pMediaControl", L"NULL == pMediaControl", MB_OK);
return 0 ;
}
pMediaControl->Run();
// Block until the user clicks the OK button.
// The filter graph runs on a separate thread.
MessageBox(NULL, szFilePath, L"DirectShow", MB_OK);
// Clean up.
pMediaControl->Release();
pGraph->Release();
CoUninitialize();
return 0;
}
编译出错:
Compiling...
play.c
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\reftime.h(42) : error C2099: initializer is not a constant
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\reftime.h(50) : error C2061: syntax error : identifier 'CRefTime'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\reftime.h(50) : error C2059: syntax error : ';'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\reftime.h(51) : error C2449: found '{' at file scope (missing function header?)
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\reftime.h(112) : error C2059: syntax error : '}'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(71) : error C2061: syntax error : identifier 'tag_ObjectDesc'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(72) : error C2059: syntax error : '}'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(307) : error C2061: syntax error : identifier 'CGuidNameList'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(307) : error C2059: syntax error : ';'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(307) : error C2449: found '{' at file scope (missing function header?)
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(310) : error C2059: syntax error : '}'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(335) : error C2061: syntax error : identifier 'CDispBasic'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(335) : error C2059: syntax error : ';'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(336) : error C2449: found '{' at file scope (missing function header?)
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxdebug.h(343) : error C2059: syntax error : '}'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxutil.h(23) : error C2061: syntax error : identifier 'CCritSec'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxutil.h(23) : error C2059: syntax error : ';'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxutil.h(23) : error C2449: found '{' at file scope (missing function header?)
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxutil.h(61) : error C2059: syntax error : '}'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxutil.h(111) : error C2061: syntax error : identifier 'CAMEvent'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxutil.h(111) : error C2059: syntax error : ';'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxutil.h(112) : error C2449: found '{' at file scope (missing function header?)
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxutil.h(134) : error C2059: syntax error : '}'
c:\program files\windows ce tools\wce400\standardsdk\include\armv4\wxutil.h(157) : error C2485: 'novtable' : unrecognized extended attribute
...
stopping compilation
Error executing clarm.exe.
play.exe - 102 error(s), 0 warning(s)
|
|