主题:急求各位帮忙,vc++编译错误,在线等!!!!
请大侠们给出解决方案:::::::::::::::::谢谢!!!!!!!
这几个文件谁能给我一下,我找不到啊!!!!!!!!!!
dmusici.h
dmusici.h
dmusicf.h
T3DLIB1.h
T3DLIB2.h
T3DLIB3.h
下面是原代码:::::::::::::
//T3DCONSOLEALPHA1.CPP
//包含文件///////////////////////////////////////////////////
#define INITGUID //确保所有的COM接口可用
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#include <mmsystem.h>
#include <iostream>
#include <conio.h>
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <math.h>
#include <io.h>
#include <fcntl.h>
#include <ddraw.h>
#include <dsound.h>
#include <dmksctrl.h>
#include <dmusici.h>
#include <dmusicc.h>
#include <dmusicf.h>
#include <dinput.h>
#include "T3DLIB1.h"
#include "T3DLIB2.h"
#include "T3DLIB3.h"
using namespace std;
//常量///////////////////////////////////////////////////
//用于Windows接口的常量
#define WINDOW_CLASS_NAME "WIN3DCLASS" //类名
#define WINDOW_TITLE "T3D Graphics Console Ver 2.0"
#define WINDOW_WIDTH 640 //窗口大小
#define WINDOW_HEIGHT 480
#define WINDOW_BPP 16 //窗口的位深
#define WINDOWED_APP 1 //0表示非窗口模式,1表示窗口模式
//函数原型///////////////////////////////////////////////////
//游戏控制台函数
int Game_Init(void *parms=NULL);
int Game_Shutdown(void *parms=NULL);
int Game_Main(void *parms=NULL);
//全局变量///////////////////////////////////////////////////
HWND main_window_handle = NULL;//用于存储窗口句柄
HINSTANCE main_instance = NULL;//用于存储实例
char buffer[256]; //用于打印文本
//函数///////////////////////////////////////////////////////
LRESULT CALLBACK WndProc(HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam)
{
PAINTSTRUCT ps;
HDC hdc;
switch(msg)
{
case WM_CREATE:
{
//执行初始化工作
return(0);
}break;
case WM_PAINT:
{
//开始绘制
hdc = BeginPaint(hWnd,&ps);
//结束绘制
EndPaint(hWnd,&ps);
return(0);
}break;
case WM_DESTROY:
{
//删除应用程序
PostQuitMessage(0);
return(0);
}break;
default:break;
}//end switch
//处理其他消息
return DefWindowProc(hWnd, message, wParam, lParam);
}//end WinProc
//WINMAIN////////////////////////////////////////////////////
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
//这是winmain函数
WNDCLASS winclass;
HWND hwnd;
MSG msg;
HDC hdc;
PAINTSTRUCT ps;
winclass.style = CS_DBLCLKS | CS_OWNDC |
CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc = WindowProc;
winclass.cbClsExtra = 0;
winclass.cbWndExtra = 0;
winclass.hInstance = hinstance;
winclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
winclass.hCursor = LoadCursor(NULL, IDC_ARROW);
winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName = NULL;
winclass.lpszClassName = WINDOW_CLASS_NAME;
//注册窗口类
if (!RegisterClass(&winclass))
return(0);
//创建窗口,根据WINDOWED_APP是否为true选择合适的窗口标记
if (!(hwnd = CreateWindow(WINDOW_CLASS_NAME,//窗口类
WINDOW_TITLE, //标题
(WINDOWED_APP ? (WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION) :
(WS_POPUP | WS_VISIBLE)),
0,0, //位置
WINDOW_WIDTH, //宽度
WINDOW_HEIGHT, //高度
NULL, //父窗口句柄
NULL, //菜单句柄
hinstance,//实例
NULL))) //创建参数
return(0);
//将窗口句柄和实例存储到全局变量中
main_window_handle = hwnd;
main_instance = hinstance;
//调整窗口大小,使客户区域的大小为width x height
if (WINDOWED_APP)
{
RECT window_rect = {0,0,WINDOW_WIDTH-1,WINDOW_HEIGHT-1};
//调用函数来调整window_rect
AdjustWindowRectEx(&window_rect,
GetWindowStyle(main_window_handle),
GetMenu(main_window_handle) != NULL,
GetWindowExStyle(main_window_handle));
//将客户区域偏移量保存到全局变量中
window_client_x0 = -window_rect.left;
window_client_y0 = -window_rect.top;
//调用MoveWindow()来移动窗口
MoveWindow(main_window_handle,
0,//水平位置
0,//垂直位置
window_rect.right - window_rect.left, //宽度
window_rect.bottom - window_rect.top,//高度
FALSE);
//显示窗口
ShowWindow(main_window_handle, SW_SHOW);
}//end if windowed
//执行游戏特有的所有初始化
Game_Init();
SystemParametersInfo(SPI_SCREENSAVERRUNNING, TRUE, NULL, 0);
//进入事件主循环
while(1)
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
//检查是否为退出消息
if (msg.message == WM_QUIT)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}//end if
//主游戏处理工作
Game_Main();
}//end while
//关闭游戏并释放所有资源
Game_Shutdown();
SystemParametersInfo(SPI_SCREENSAVERRUNNING, TRUE, NULL,0);
//返回到Windows操作系统
return(msg.wParam);
}//end WinMain
//T3DII游戏编程控制台函数////////////////////////
int Game_Init(void *parms);
{
//所有的游戏初始化工作都在这个函数中执行
//启动DirectDraw
DDraw_Init(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_BPP, WINDOW_APP);
//初始化directinput
DInput_Init_Keyboard();
//在这里加入接管其他directinput设备的函数调用...
//初始化directsound和directmusic
DSound_Init();
DMusic_Init();
//隐藏鼠标
ShowCursor(FALSE);
//随机数生成器
srand(Start_Clock());
//在这里加入初始化代码...
//成功返回
return(1);
}//end Game_Init
/////////////////////////////////////////////////////////////////
int Game_Shutdown(void *parms);
{
//这是游戏的核心,将不断的被实时调用
//它类似于C语言中的main(),所有游戏调用都是在这里进行的
//游戏逻辑
//关闭directsound
DSound_Stop_All_Sounds();
DSound_Delete_All_Sounds();
DSound_Shutdown();
//关闭directmusic
DMusic_Delete_All_MIDI();
DMusic_Shutdown();
//释放所有输出设备
DInput_Release_Keyboard();
//关闭directinput
DInput_Shutdown();
//最后关闭directdraw
DDraw_Shutdown();
//成功返回
return(1);
}//end Game_Shutdown
/////////////////////////////////////////////////////////////////
int Game_Main(void *parms)
{
int index;//循环变量
//启动定时时钟
Start_Clock();
//清空缓存
DDraw_Fill_Surface(lpddsback, 0);
//读取键盘和其他设备输入
DInput_Read_Keyboard();
//在这加入游戏逻辑代码...
//交换缓存
DDraw_Flip();
//同步到30帧/秒
Wait_Clock(30);
//检查用户是否要退出
if (KEY_DOWN(VK_ESCAPE)) || keyboard_state[DIK_ESCAPE])
{
PostMessage(main_window_handle, WM_DESTROY,0,0);
}// end if
//成功返回
return(1);
}//end Game_Main
编译错误
1>------ Build started: Project: hls game, Configuration: Debug Win32 ------
1>Build started 2009/7/17 10:53:02.
1>IsProjectFileNewer:
1>Skipping target "IsProjectFileNewer" because all output files are up-to-date with respect to the input files.
1>_PrepareForBuild:
1> Touching ".\Debug\lastbuild.timestamp".
1>cl : Command line error D8016: '/ZI' and '/Ob1' command-line options are incompatible
1>FileTracker : warning : Attempt to load UI satellite dll from C:\Windows\Microsoft.NET\Framework\v4.0.20506\2052\FileTrackerUI.dll failed.
1>FileTracker : warning : Attempt to load UI satellite dll from C:\Windows\Microsoft.NET\Framework\v4.0.20506\2052\TrackerUI.dll failed.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.68
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========