在stdafx.h中定义如下:
#include <afxwin.h>
#include <mmsystem.h>
#include <mmreg.h>
#pragma comment(lib,"winmm.lib")
#include <ddraw.h>
#pragma comment(lib,"ddraw.lib")
//DirectInput
#include <dinput.h>
#pragma comment(lib,"dinput.lib")
//DirectSound
#include <dsound.h>
#pragma comment(lib,"dsound.lib")//DirectXGUI
#pragma comment(lib,"dxguid.lib")
在frame.cpp中定义如下:
#define DIRECTINPUT_VERSION 0x0700
#include "stdafx.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endifIMPLEMENT_DYNCREATE(canvasFrame, CFrameWnd)// DirectDraw
LPDIRECTDRAW7 DD;
LPDIRECTDRAWSURFACE7 DDSur;
LPDIRECTDRAWSURFACE7 DDBuf;
LPDIRECTDRAWSURFACE7 DDPla[10];
DDSCAPS2 DDcaps;
DDSURFACEDESC2 DDde;
HRESULT result;
DDCOLORKEY key;出现错误如下:
error C2146: syntax error : missing ';' before identifier 'DD'
error C2501: 'LPDIRECTDRAW7' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found
Error executing cl.exe.
请大虾们帮帮忙!谢谢!
#include <afxwin.h>
#include <mmsystem.h>
#include <mmreg.h>
#pragma comment(lib,"winmm.lib")
#include <ddraw.h>
#pragma comment(lib,"ddraw.lib")
//DirectInput
#include <dinput.h>
#pragma comment(lib,"dinput.lib")
//DirectSound
#include <dsound.h>
#pragma comment(lib,"dsound.lib")//DirectXGUI
#pragma comment(lib,"dxguid.lib")
在frame.cpp中定义如下:
#define DIRECTINPUT_VERSION 0x0700
#include "stdafx.h"#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endifIMPLEMENT_DYNCREATE(canvasFrame, CFrameWnd)// DirectDraw
LPDIRECTDRAW7 DD;
LPDIRECTDRAWSURFACE7 DDSur;
LPDIRECTDRAWSURFACE7 DDBuf;
LPDIRECTDRAWSURFACE7 DDPla[10];
DDSCAPS2 DDcaps;
DDSURFACEDESC2 DDde;
HRESULT result;
DDCOLORKEY key;出现错误如下:
error C2146: syntax error : missing ';' before identifier 'DD'
error C2501: 'LPDIRECTDRAW7' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found
Error executing cl.exe.
请大虾们帮帮忙!谢谢!
解决方案 »
- 基于对话框的MFC程序能加入欢迎画面吗
- BCG的cbcgpgridctrl 其中一个item变成下拉菜单 类似combox
- 请教一个小问题,关于那个debug迷你工具栏的问题
- P2P文件传送的例子,谁有啊?
- 谁给偶讲讲vc到底能创建几种DLL,区别是啥啊
- 在win32里面怎么让激活对话框里一个被设置了disabled为true(被禁止使用)的控件?
- 请教SQL 中create table的一个问题
- MS DataGrid的显示
- 高手帮忙!安装老出问题啊,Help!!
- 请教高手一个关于文档/视图类中新建一个文档的问题?
- 任何得到dll父窗口指针?
- 在vc中写串口通信程序,如何知道收到的数据是一帧,就是说如何知道这个byte是下一帧的开始,或是上一帧的数据
这个错误你可以检查一下大括号的配对等问题
error C2146: syntax error : missing ';' before identifier 'DD'
看一下LPDIRECTDRAW7 是怎么定义的。
error C2501: 'LPDIRECTDRAW7' : missing storage-class or type specifiers
和上面的错误相关,上面的解决了, 这个肯定就没问题了