Sign in to follow this  
killevan

Help! Gods trying to stop me from programming

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
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
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.

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
Quote:
Original post by killevan
Nuthin...whats going on? do I open something in SDK? do I freakin sprinkle pixie dust on the monitor? what the hell!?!


If you read the instructions on the download page you would see that it says your downloading a Image of the CD. That means you either have to a) burn it onto a CD and then install it off your cdrom or b) you download and daemon-tools then mount it to a fake cdrom drive (using daemon-tools which is accessable by rightclicking on the red lightning bolt on your systry/taskbar) and install it from there.

Im assuming this is what happened: You downloaded it and have tried to install the PSDK by double clicking the image file because your above quoted post does not look like a compiler error?

Or have you actually installed the PSDK? If so and I have assumed wrong what is the exact error that Microsoft Visual Studio gives you.

Share this post


Link to post
Share on other sites
Quote:
Original post by killevan
Nuthin...whats going on? do I open something in SDK? do I freakin sprinkle pixie dust on the monitor? what the hell!?!


Only use the pink pixie dust. The green variety makes things invisible, not visible.

And really, if your god's being an ass and stopping you from programming, switch to a new one! It helps sometimes. Especially if you sacrifice a few MB of RAM to them just to get past the noob worshipper stage more quickly.

N.B. Obviously god is interchangeable with goddess here if one of the females takes your fancy. Artemis might be good for your purposes. Don't go for Persephone, she's only around half the time anyway.

Some gods prefer other things to RAM. Kittens for example, or possibly insects

>.>

Share this post


Link to post
Share on other sites
I had the exact same problem with the exact same book. I'd tell you how to fix it but I gotta go to class in 5 minutes... maybe later

EDIT: Nevermind, the problem I encountered had to do with the example programs not compiling with the SDK provided on the CD, because the parameters were different. Looks like you're having a different problem.

[Edited by - UltimateWalrus on March 10, 2007 5:04:03 PM]

Share this post


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


So and so is the program I'm trying to run;it's written as the path:
c:\documents and settings\joe\my documents\visual studio 2005\projects\helloworld\debug\HelloWorld.exe

Quote:
Original post by Zahlman
Also, what steps *exactly* are you trying, in order to create the program?


I open MSVS File>New>Project Choose Win32 Consule Application, go to Application settings, and set to Windows Application and Empty Project. After writting the program I click the *Play* button that activates the debug and starts the program. After wards I get the notice that says that it couldn't start because the file was not found. Then when I build the program if the build works that time it will say that windows .h is not specified or cannot be found, and when I delete the line that contains "#include <windows.h>, it says there are many other errors.

Quote:
Original post by Zahlman
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.)


Not sure what you mean

Share this post


Link to post
Share on other sites
Quote:
Original post by parawizard
Or have you actually installed the PSDK? If so and I have assumed wrong what is the exact error that Microsoft Visual Studio gives you.


I did get it installed, thanks anyways

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this