Skip to main content
GameDev.net gamedev.net
🔒 Locked

Help! Gods trying to stop me from programming

Started by killevan Mar 8, 2007 at 6:08 PM 128 replies 30.3k views
Original Post
killevan
killevan
I'm reading this book and I've followed the steps but when I build the given code it says the that it is an error where it cannot find a certain file, and when I debug to execute the programming it says that the file (the program written) cannot be found. Whats the problem?
killevan
killevan
The book is Beginning Game Programming Second Edition by Johnathan S. Harbour from Thomson Course Technology and I am using Visual Sttudio C++ 2005 Express Edition, and DirectX. If that helps
jouley
jouley
If there's not too much code, post it here between [source] and
[/source] tags to format it nicely. Also, post the specific errors you get if they're compilation errors, or the message you get if it's a runtime error.

What compiler are you using, for what language? What debugger? Is it an IDE (Visual Studio? Eclipse?)?

When it comes to answering "What's the problem," the more info you give, the better. [smile]

-jouley

[Edit: Getting there...]
killevan
killevan
Yeah it is an IDE it's Visual C++ 2005 Express Edition
Chad Smith
Chad Smith
Post the error, so I can see which file it can not find. Also post the code, if it is not very long. Just put it between [ source][ /source] (without the spaces) tags, that way your code is formatted in a nice white box.


Chad.

killevan
killevan
// Beginning Game Programming
// Chapter 2
// HelloWorld program

//#define WIN32_LEAN_AND_MEAN

#include
//#include

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nShowCmd)
{
MessageBox(NULL, "Motoko Kusanagi has hacked your system!",
"Public Security Section 9", MB_OK | MB_ICONEXCLAMATION);

return 0;

}
This is the exact source they gave me and im frustrated 'cause i'm thinking that if i can't get a code like this running i'm pretty screwed. I'm even having trouble now it's not allowing me to build or debug for some reason. But from what I can recall the error was in #include and when I removed that text most of the other lines ended up having errors as well. But the problem that started it all was that it was saying that windows.h didn't exist and I can't understand why then it would be in the book and the CD's version.
jouley
jouley
Visual Studio 2005 doesn't come with the Windows Platform SDK. This means you can't just up and start programming Windows applications. This will walk you through the process of downloading, installing, and configuring the SDK.

The error you got when you tried to debug the program was because the program was never compiled. If it's not compiled, you can't run it. Makes sense...

It's important to note that you may not want to start programming with Windows anyway, there's plenty you can do without the Platform SDK. Learning C++ is tricky enough on its own.

-jouley

[Edit: This is a good guide for learning C++ without being tied to Windows programming. It's free, too! Here's another that's a little more advanced, but easier to read.]
killevan
killevan
Before I check your link isnt building a program compiling it?
Charabis
Charabis
But if it doesn't compile successfully, it doesn't actually generate useable code. [smile]
My name is "Todd". Drop the "T" and it explains sooooooo much! :P
killevan
killevan
So what will Platform SDK do for me?
killevan
killevan
It's giving me multiple option to download from. Its saying Download the files most appropriate for you out of:
PSDK-amd64.exe
PSDK-ia64.exe
PSDK-x86.exe
which one(s) is/are the apropriate one(s). They gave an example using PSDK-x86.exe.
TheTroll
TheTroll
Unless you have a 64bit computer, then the x86 is the one for you.

theTroll
killevan
killevan
Well that took a while but it's downloaded. So is that it or is there more that I have to do?
killevan
killevan
Still saying cannot start program so and so The system cannot find the file specified. What else do I have to do?
KulSeran
KulSeran
If you followed all the instructions for installing the PSDK, then it should probably be working.
BUT there is a chance that it didnt automatically add itself to the VS IDE, so you need to go into
the tools -> options -> projects -> VS directories
and manually add in the include/lib paths for where you installed the PSDK to.
killevan
killevan
Nuthin...whats going on? do I open something in SDK? do I freakin sprinkle pixie dust on the monitor? what the hell!?!
Zahlman
Zahlman
When it says "so and so the system cannot find the file specified", what is the "so and so"? *Exactly*? Copy and paste it into the post.

Also, what steps *exactly* are you trying, in order to create the program? Can you find a file on the hard drive that contains the code? What is it named? *Exactly?* (Make sure that Windows isn't hiding your filename extensions.)
JohnBolton
JohnBolton
Quote:
Original post by jouley
post the specific errors you get if they're compilation errors, or the message you get if it's a runtime error.
Quote:
Original post by Chad Smith
Post the error, so I can see which file it can not find.
Quote:
Original post by Zahlman
When it says "so and so the system cannot find the file specified", what is the "so and so"? *Exactly*? Copy and paste it into the post.
In case you missed them the first time...
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.