• Advertisement
Sign in to follow this  

Problem runing program from book

This topic is 3969 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've read some of "Beginning Game programing" a while ago but i stop for a while, recently i started reading it again and on the second chapter i can not get the programs to Run in MSVC 2005 Express Edition(in the book it say every thing should work fine with that compiler, and it did the first time a read the book) But now when i try to run programs form the book that i have type or off the CD (i have tried more then one program) the program dose not run, when i go to debug it says this project is out of date and shows the project in the box below, when i click Build is says that there were build errors, would like to continue and i click yes, then it say it cannot find the path specified. The first time i read the book I'm not sure what i used as a template when i started a new project because in the book it say to use Win32 project but that is not in MSVC 2005 its from 2003( i think) i can't remember what i put instead of it the first time i read the book and i've tried a lot of different one's My questions are what I'm i doing wrong and what should i do different to get the programs to run, and what should i use as a template in Visual Studio C++ 2005 for a windows application The only difference for now and then is I'm using a new computer, and installed MSVC recently and maybe there been some changes in it or something Please Help, i want to start programming again

Share this post


Link to post
Share on other sites
Advertisement
I know that Win32 applications are disabled in VC2005 express edition, I think there is a way to change this but I'm not sure what it is.

When the program tells you there are build errors, this means it did not compile/link your code because there is an error somewhere. The reason click "Yes to continue" isn't working is because there is no executable being created, due to the errors.

VC2005 Express confused me when I started using it because there are some interface changes, but it would be helpful to see both the code you are trying to compile as well as the errors you are receiving. Your build errors should be in the bottom box of VC. If you look there should be a few tabs, Code Definition Window, Call Browser, Output, and Error List depending on the windows you have enabled. If you don't see Error List on one of these tabs, simply go to View->OtherWindows and select Error List. Once its enabled it will show up in the bottom box as one of the tabs.

Seeing your code and knowing the errors you are receiving will allow someone to help you with your problem.

*EDIT* When I was using express I would just start with an empty project, and copy the WIN32 code I had used in other projects, its a bit tedious, but it will get the job done.

Share this post


Link to post
Share on other sites
Yes. My book of "Beginning Game Programming" (ISBN I-59200-585-3) is expressly written for VC2003. Although I haven't picked up this book in a year, I still use VC2003 exclusively because most of my manuals still use that for examples.

When I have tried to use VC2005 (VC++ Version 6.0, is it?) on existing projects, I have come up with numerous errors. Building projects exclusively from VC2005 seems the way to go.

If you have your VC2003 compiler around, use that to reintroduce yourself to the basics while you learn the differences between the compilers. As a side note, I was talking with some guys from a dev house here, and they still use VC2003. Not sure if that's worth anything, but good luck!


** edit **
To the above P.S.: Always start your projects as empty.

Share this post


Link to post
Share on other sites
Yes I went back to 2003 after using the 2005EE. BTW I believe VC2005 is version 8.0. Good to know about the empty projects though, I often create my projects empty because I do not like the pre-written code from VS.

Share this post


Link to post
Share on other sites
Quote:
Original post by argonaut
Yes. My book of "Beginning Game Programming" (ISBN I-59200-585-3) is expressly written for VC2003. Although I haven't picked up this book in a year, I still use VC2003 exclusively because most of my manuals still use that for examples.

When I have tried to use VC2005 (VC++ Version 6.0, is it?) on existing projects, I have come up with numerous errors. Building projects exclusively from VC2005 seems the way to go.

If you have your VC2003 compiler around, use that to reintroduce yourself to the basics while you learn the differences between the compilers. As a side note, I was talking with some guys from a dev house here, and they still use VC2003. Not sure if that's worth anything, but good luck!


** edit **
To the above P.S.: Always start your projects as empty.


Where do i get VC2003, it's not on the book CD

Share this post


Link to post
Share on other sites
Quote:
Original post by TheN00B
I know that Win32 applications are disabled in VC2005 express edition, I think there is a way to change this but I'm not sure what it is.

When the program tells you there are build errors, this means it did not compile/link your code because there is an error somewhere. The reason click "Yes to continue" isn't working is because there is no executable being created, due to the errors.

VC2005 Express confused me when I started using it because there are some interface changes, but it would be helpful to see both the code you are trying to compile as well as the errors you are receiving. Your build errors should be in the bottom box of VC. If you look there should be a few tabs, Code Definition Window, Call Browser, Output, and Error List depending on the windows you have enabled. If you don't see Error List on one of these tabs, simply go to View->OtherWindows and select Error List. Once its enabled it will show up in the bottom box as one of the tabs.

Seeing your code and knowing the errors you are receiving will allow someone to help you with your problem.

*EDIT* When I was using express I would just start with an empty project, and copy the WIN32 code I had used in other projects, its a bit tedious, but it will get the job done.


// 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;

}




1>------ Build started: Project: 787, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>e:\sources\chapter02\HelloWorld\main.cpp(7) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
1>Build log was saved at "file://c:\Documents and Settings\Chris\My Documents\Visual Studio 2005\Projects\787\787\Debug\BuildLog.htm"
1>787 - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Share this post


Link to post
Share on other sites
I didn't see this mentioned anywhere, so here goes: Platform SDK. You can't make win32 programs in Visual C++ Express Edition without it. Read the directions thoroughly as it's easy to mess up.

Also, I think that you've been getting the versions messed up.

has released really only 5 (the 6th is coming out in a year or so and is in public beta for the express editios) major IDEs since 1997. Visual Studio in '97, Visual Studio 6.0 in 1998, Visual Studio.NET in 2002 aka 7.0, Visual Studio.NET 2003 aka 7.1, Visual Studio 2005 (no .NET in name any more) aka 8.0, and eventually Visual Studio 2008 code-named Orcas. This information and more can be had from Wikipedia.

Share this post


Link to post
Share on other sites
Quote:
Original post by nobodynews
I didn't see this mentioned anywhere, so here goes: Platform SDK. You can't make win32 programs in Visual C++ Express Edition without it. Read the directions thoroughly as it's easy to mess up.


how do i do that


Share this post


Link to post
Share on other sites
Here is the link. I had to do this too.

http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/

I also notice that some of the older DirectX will not compile correctly with some new versions of the platform SDK.

Share this post


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

  • Advertisement