Sign in to follow this  
potatomanjack

Building with first program with Visual C++ Express Beta 2005

Recommended Posts

Hello all, I'm sure this will ound like one of the most basic/stupid questions, but I'm completely stumped. I've been trying to BUILD my very first project in the above mentioned compiler, and I just can't get it to produce a .exe file. I've entered all the code as stated in the book, and then I go to 'build' drop down to 'build hello' and click.... and nothing really happens. I get the message that '0 succeeded, 0 failed, 1 up-to-date, 0 skipped'. I try and run hello, and it says it can't find hello.exe I searched my entire hardrive for hello.exe and it doesn't exist, and so it's not the path that doesn't work. What I would really appreciate, is if someone could tell me what I'm doing wrong, or better yet, walk me through the entire process (except for the coding) of startign a new project, making a new file, and then building an executable program, just to say hello. I realize that this is a big request, but I really want to get into learning programming, and this is halting me on my first step. Thanks!

Share this post


Link to post
Share on other sites
Nothing happens because it builds it so quick. I'm not exactly sure what "up-to-date" means because I'm still using VS2003, but try finding the option "start without debuging" in the menu; if you're program exists, it will start.

Share this post


Link to post
Share on other sites
It's saying that it's up-to-date because it can't find any changes to your code. If you change your code and it still says that, you should make sure that your source file is included in the project and not just an open window. (Go to project->add existing item and add your file), and also make sure you didn't accidentally check "exclude from build" in the cpp file's properties.

Share this post


Link to post
Share on other sites
I'm really not sure why it would do that, so I recommend you scrap the project (but not the code) and do these steps:

- Save your code into a .cpp file.

- Go to File->New->Project and create a new project in your desired location and of the appropriate type (most likely Win32 Console).

- In the project settings dialogue which appears you will most likely want to make sure that "Empty project" is checked and that "Precompiled header" is not.

- Move the .cpp file you created into the folder Visual C++ created for your project.

- In the Solution Explorer, right-click your project name, go to Add->Add Existing Item. In the file browse dialogue, select the .cpp file you just moved in the las tstep.

- Now go to Build->Build Solution or Build->Build <Insert Project Name>. It will likely build your project very quickly.

- Assuming no errors, go to Debug->Start Debugging or Debug->Start Without Debuggin to run the program.

HTH,
nilkn

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