• Create Account

## 02.07 - The Readiness Test

215 replies to this topic

### #1Teej  GDNet+

Posted 20 April 2001 - 04:05 AM

Oh Goody, Code Time! Alright recruits, we’re about to test your compiling and linking skills. I’ve added a zipfile called BASECODE1 on my website that I’d like you to download now (don’t unzip it yet though!). The zipfile contains the following files:
• Globals.h – the main header file for the game template
• WinBase.cpp – the windows application overhead we’ve discussed
• InitTerm.cpp – the initialization/shutdown functions
• GameMain.cpp – where the game code goes
• Utils.h – prototypes for our helper functions
• Utils.cpp – the helper functions themselves
• Resource.bmp – a sample bitmap
• Sample.wav – a sample WAV file
• DDRAW.H
• DINPUT.H
• DSOUND.H
…which contains prototypes for the DirectDraw, DirectInput and DirectSound components we’re using. The actual components (the DirectX runtimes) are called:
• DDRAW.DLL
• DINPUT.DLL
• DSOUND.DLL
…which are the files that everyone has for playing DirectX games with. Finally, we have library files that connect code using DirectX components:
• DDRAW.LIB
• DINPUT.LIB
• DSOUND.LIB
Compiling...
GameMain.cpp
c:\gdn\basecode\globals.h(87) : error C2146: syntax error : missing ';' before identifier 'lpDD'
c:\gdn\basecode\globals.h(87) : error C2501: 'LPDIRECTDRAW7' : missing storage-class or type specifiers
c:\gdn\basecode\globals.h(87) : error C2501: 'lpDD' : missing storage-class or type specifiers
c:\gdn\basecode\globals.h(88) : error C2146: syntax error : missing ';' before identifier 'lpDDSPrimary'
c:\gdn\basecode\globals.h(88) : error C2501: 'LPDIRECTDRAWSURFACE7' : missing storage-class or type specifiers
c:\gdn\basecode\globals.h(88) : error C2501: 'lpDDSPrimary' : missing storage-class or type specifiers
c:\gdn\basecode\globals.h(89) : error C2146: syntax error : missing ';' before identifier 'lpDDSBack'
c:\gdn\basecode\globals.h(89) : error C2501: 'LPDIRECTDRAWSURFACE7' : missing storage-class or type specifiers
c:\gdn\basecode\globals.h(89) : error C2501: 'lpDDSBack' : missing storage-class or type specifiers
c:\gdn\basecode\globals.h(90) : error C2146: syntax error : missing ';' before identifier 'lpDDSRes'
c:\gdn\basecode\globals.h(90) : error C2501: 'LPDIRECTDRAWSURFACE7' : missing storage-class or type specifiers
c:\gdn\basecode\globals.h(90) : error C2501: 'lpDDSRes' : missing storage-class or type specifiers
c:\gdn\basecode\globals.h(94) : error C2146: syntax error : missing ';' before identifier 'lpDI'
c:\gdn\basecode\globals.h(94) : error C2501: 'LPDIRECTINPUT7' : missing storage-class or type specifiers

(…on and on…) then you probably need to make sure that you’re pointing the IDE to the DirectX header files (look in Tools|Options|Directories ). If you have other compile errors, try to get ahold of me (teej@gdnmail.net or 70816765 on ICQ) or post a reply to this article with your questions. As for the linking, well, that’s primarily the job of the LIB list we prepared under Project|Settings|Link. Here’s an example of having it entered incorrectly:
Linking...
InitTerm.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16
InitTerm.obj : error LNK2001: unresolved external symbol _IID_IDirectDraw7
InitTerm.obj : error LNK2001: unresolved external symbol _c_dfDIKeyboard
InitTerm.obj : error LNK2001: unresolved external symbol _GUID_SysKeyboard
InitTerm.obj : error LNK2001: unresolved external symbol _IID_IDirectInputDevice7A
InitTerm.obj : error LNK2001: unresolved external symbol _DirectInputCreateEx@20
InitTerm.obj : error LNK2001: unresolved external symbol _IID_IDirectInput7A
InitTerm.obj : error LNK2001: unresolved external symbol _DirectSoundCreate@12
Debug/basecode.exe : fatal error LNK1120: 8 unresolved externals

basecode.exe - 9 error(s), 0 warning(s)

• An introduction to game development
• A basic windows application framework
• C language resources
• A quick overview of some of the basic tools required
• Some insight into how a game might be written
• Information on resolutions, colors and pixel plotting
• The role of DirectX in our games
• A first run with some game template code
Congratulations… You have your compiler/linker in order, the DirectX runtimes and SDK installed, the online documentation at your fingertips, and some template code that sits before you like an open book with blank pages – ready to be filled in with the knowledge and practice that is the rite of passage for any apprentice. Get ready folks, because next up is the proverbial ‘Square One’. See you there. Questions? Comments? Can’t get the damned code to build? Reply to this article – help is on the way! Edited by - teej on April 20, 2001 11:10:00 AM

### #2Fighterdude  Members

Posted 20 April 2001 - 10:10 AM

i can build the program fine errors 0 and warnings 0
but when i try to run it says DD_init faild.|-7

Fighterdude(A Baldurs Gate Fan)

### #3Lord Maz  Banned

Posted 20 April 2001 - 10:26 AM

I can''t get my modem to download those directx files.. the connection is too slow, and it stoppes after a while
If anyone could upload the files on a better server (or buy me a better modem!), I would be gratefull!

-Lord Maz-

### #4Qunu  Members

Posted 20 April 2001 - 11:06 AM

Fighterdude: make sure you have the resource.bmp and sample.wav files in the same directory as your executable.

### #5Anonymous Poster_Anonymous Poster_*  Guests

Posted 20 April 2001 - 11:07 AM

Fighterdude: make sure you have the resource.bmp and sample.wav files in the same directory as your executable.

### #6Crox_guldtand  Members

Posted 20 April 2001 - 11:29 AM

Hey Fighter dude!

You haven´t got the "resource.bmp" file in the same catalog/dir.
as the other files.
Just put it there and it´ll work fine.

### #7Fighterdude  Members

Posted 20 April 2001 - 02:27 PM

i have them all in the same directory
and it still does the same thing.

Fighterdude(A Baldurs Gate Fan)

### #8Fighterdude  Members

Posted 20 April 2001 - 02:30 PM

Forget the last post i just got what you were saying and it works now Thanks Guys

Fighterdude(A Baldurs Gate Fan)

### #9Fighterdude  Members

Posted 20 April 2001 - 03:01 PM

Just wonderin Teej is the next artical the C LANGUEGE or you gonna post a new one? Great job Teej i realy like it!

Fighterdude(A Baldurs Gate Fan)now that''s a good Game

### #10Fighterdude  Members

Posted 20 April 2001 - 03:01 PM

Just wonderin Teej is the next artical the C LANGUEGE or you gonna post a new one? Great job Teej i realy like it!

Fighterdude(A Baldurs Gate Fan)now that''s a good Game

### #11Fighterdude  Members

Posted 20 April 2001 - 03:03 PM

sorry for Multi-Post

Fighterdude(A Baldurs Gate Fan)

### #12Fighterdude  Members

Posted 20 April 2001 - 05:14 PM

do i have to get the online version or can i get it in word format?

Fighterdude(A Baldurs Gate Fan)

### #13Fighterdude  Members

Posted 20 April 2001 - 05:16 PM

The Docs i mean!

### #14Mucman  Members

Posted 20 April 2001 - 06:59 PM

Well I''ll be darned! It worked at the first build! Should I be surprised

"You won''t get wise with the sleep still in your eyes." - Neil Peart

### #15Thalion  Members

Posted 21 April 2001 - 07:59 AM

Why do I get this error?

Compiling...
WinBase.cpp
InitTerm.cpp
Utils.cpp
GameMain.cpp
LINK : fatal error LNK1104: cannot open file "C:\program.obj"

### #16Higgenkreuz  Members

Posted 21 April 2001 - 08:05 AM

I get the following messages while I try to compile:
d:\dxvcsdk\lib\ddraw.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x389bc793

I checked the path to my lib file, it is fine, also, I still have some 150MB of free space on my HD.

Any ideas?

### #17Scogs  Members

Posted 21 April 2001 - 11:42 AM

Thalion,

I had the same error as you, so I deleted the project, re-installed the SDK, followed Teej''s instructions again and it all worked fine. Try it, you never know it might work?

Scogster.

PS. Teej your a top man.

Posted 21 April 2001 - 02:42 PM

i cant find the site if you can send me the adress or the files to my email i will apreciate it.

you are doing a good job

my email is thadarkangel@hotmail.com

Edited by - thadarkangel on April 21, 2001 9:44:42 PM

### #19Mucman  Members

Posted 21 April 2001 - 04:59 PM

As for readiness, are we expected to know and understand what the heck all those utility functions do? Or know exactly how the implementation works?

"You won''t get wise with the sleep still in your eyes." - Neil Peart

### #20Piotyr  Members

Posted 21 April 2001 - 05:25 PM

At this point, just think of it as a black box "template" to program your game code in. The only function you need to worry about if you use the template is really the Game_Main function, and perhaps a bit about the shutdown and/or init functions. Don''t get overwhelmed. If you''re completely lost, there are some good tutorials around on DirectX to learn more than what Teej overviewed thus far, and he might even go more in-depth at a later time.