Sign in to follow this  
Fixxer

DDraw Help

Recommended Posts

Fixxer    100
I am trying to start learning direct draw, and I am coming across these errors and do not know how to fix them. ------ Build started: Project: T3D Game Shell, Configuration: Debug Win32 ------ Compiling... main.cpp .\main.cpp(192) : error C2062: type 'void' unexpected .\main.cpp(193) : error C2143: syntax error : missing ';' before '{' Build log was saved at "file://c:\Documents and Settings\Owner\Desktop\Programming\Windows Game Programming Book\Chapter 4\T3D Game Shell\T3D Game Shell\Debug\BuildLog.htm" T3D Game Shell - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== here is my code
int Game_Init(HWND hwnd)
{
	// this is called once after the window is created, and before the main loop

	LPDIRECTDRAW7 lpdd7 = NULL; // direct draw 7 interface

	if (FAILED(DirectDrawCreateEx(NULL,(**void)&lpdd7, IID_IDirectDraw7, NULL))) // line 192 ****************
	{
		//error
	}// end if

	// set cooperation level
	if (FAILED(lpdd7->SetCooperativeLevel(hwnd,DDSCL_NORMAL | DDSCL_FULLSCREEN)))
	{
		//error
	}// end if

	// return success or failure
	return(1);

}// end game init

Share this post


Link to post
Share on other sites
Fixxer    100
now i get this :x

------ Build started: Project: T3D Game Shell, Configuration: Debug Win32 ------
Compiling...
main.cpp
Linking...
main.obj : error LNK2019: unresolved external symbol _DirectDrawCreateEx@16 referenced in function "int __cdecl Game_Init(struct HWND__ *)" (?Game_Init@@YAHPAUHWND__@@@Z)
main.obj : error LNK2019: unresolved external symbol _IID_IDirectDraw7 referenced in function "int __cdecl Game_Init(struct HWND__ *)" (?Game_Init@@YAHPAUHWND__@@@Z)
C:\Documents and Settings\Owner\Desktop\Programming\Windows Game Programming Book\Chapter 4\T3D Game Shell\Debug\T3D Game Shell.exe : fatal error LNK1120: 2 unresolved externals
Build log was saved at "file://c:\Documents and Settings\Owner\Desktop\Programming\Windows Game Programming Book\Chapter 4\T3D Game Shell\T3D Game Shell\Debug\BuildLog.htm"
T3D Game Shell - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Share this post


Link to post
Share on other sites
Alpha_ProgDes    6936
Quote:
Original post by bakery2k1
You need to link to (IIRC) ddraw.lib and dxguid.lib.

i concur.
fixxer i already gave you directions to add .libs to your project. use them to do the same for your those two .libs [smile]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this