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
DDraw Help
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
here's a link that will help most of your initialization problems.
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddtut_0tkn.asp
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/ddraw7/directdraw7/ddtut_0tkn.asp
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 ==========
------ 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 ==========
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement