Help! Gods trying to stop me from programming

Started by
128 comments, last by Delsana 17 years ago
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?
Advertisement
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
The porn gods look upon you with unsavory eyes. Repent!

Beginner in Game Development?  Read here. And read here.

 

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...]
Yeah it is an IDE it's Visual C++ 2005 Express Edition
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.

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

//#define WIN32_LEAN_AND_MEAN

#include <windows.h>
//#include <windowsx.h>

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 <windows.h> 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.
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.]
Before I check your link isnt building a program compiling it?
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

This topic is closed to new replies.

Advertisement