Jump to content
  • Advertisement
Sign in to follow this  
killevan

Help! Gods trying to stop me from programming

This topic is 4173 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
// 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.

Share this post


Link to post
Share on other sites
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.]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!