Visual C++ not building program

The title says all. Here's what happens.

So, I am making a little console application and i click "save all" then I "build solution" but when I try and build it this happens:

========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

it also tells me on the bottom of the window that the build succeeded, but it didnt...

When I open the application it does a "Hello World" then quickly closes. But that is not what I am making... I am making something more complex. I thought surely it would have something...

I saved the project, I know that. Any suggestions?
have you saved the cpp file ? ( it shows an asterix to the name ,so it shows it has been modified) ...
You may try to clean the solution ,and to build it again.
Last edited on
Choose "Rebuild solution" (CTRL + ALT + F7)
I actually have multiple .cpp files as I am making a console RPG. I'll try rebuild.
How do you rebuild in Visual 2010?

I might need to add more code...
Last edited on
closed account (3hM2Nwbp)
I've once encountered a problem with Visual Studio 2010 that involved the "Enable Minimum Rebuild" option, where code changes weren't compiled until a full rebuild was invoked. This issue only first happened when my project reached around 80 classes. Obviously, a full rebuild of that size wasn't practical. The only way that I found to resolve that particular issue was to switch back to Visual Studio 2008.
Here is the code to the program i copied and pictured (the code is not mine ,and i do not hold any rights over it- it has been put on the net):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
// The program is from "Bjarne Stroustrup - Programming Principles and practice using C++"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
inline void keep_window_open() {char ch; cin>>ch;}
//all these lines are a substitute to "#include "std_lib_facilities.h" "

int main() {
	cout <<"Hello,World!\n";
	keep_window_open();
	return 0;
}

Here are the pictures i made during the process:
http://img17.imageshack.us/img17/9154/picture1creation.png
http://img402.imageshack.us/img402/282/picture2emptyproject.png
http://img3.imageshack.us/img3/1908/picture3addnewitem.png
http://img38.imageshack.us/img38/2419/picture4addcppfile.png
http://img806.imageshack.us/img806/6695/picture5savethecode.png
http://img156.imageshack.us/img156/8081/picture6buildrebuildorc.png
http://img90.imageshack.us/img90/838/picture7buildisok.png
http://img861.imageshack.us/img861/6982/picture8startwithoutdeb.png
http://img535.imageshack.us/img535/4720/picture9result.png
I`m using Visual Studio 2010 but with Visual C++ Express 2010 the menu should be the same.
I hope i helped you.
Last edited on
Well I've switched to code blocks again. And now I have a whole new set of errors that I talk about in the topic "C++ Errors"
strashko has gone thru the trouble of creating a project and running it with screenshots at every stage. The least you could do it try it.
Ok I'll try it, but please look at my other topic somewhere below this one called "C++ Errors". Because a different IDE could compile it, if it weren't for those errors. Thank you, I'll try.

EDIT: I'm gonna post source code here for the errors as well. These might be contributing to the Build 0 error in Visual C++. I am getting the errors from this .cpp file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Cross-roads

#include "Library.h"

bool Crossroads()

{
    int choice = 0;

    while (choice != 10)

    {

        cout << "You stand at a crossroads. There are several paths going off in many directions.\n\n";
        cout << "Behind you is a small market town full of shops \nand bustling with people.\n\n";

        // Player chooses his/her location

        cout << "Which path do you choose?\n";
        cout << "1: Town.\n";
        cout << "2: Summoning Portal.\n";

        if (!dcomplete)
            cout << "3: Desert Road (QUEST)\n";

        if (dcomplete && !fcomplete)
            cout << "4: Forest Road (QUEST)\n";

        if (fcomplete && !scomplete)
            cout << "5: Swamp Road (QUEST)\n";

        if (scomplete && !gcomplete)
            cout << "6: Graveyard Road (QUEST)\n";

        if (gcomplete && !ccomplete)
            cout << "7: Castle Road (QUEST)";

        cout << "10: Exit Game.";
        cout << ">";
        cin >> choice;
	}


    return true;
}


Errors(about 10-30 of these same errors): "First defined here"({?? The '{' is causing an error??!!)
"Multiple Definition of dcomplete" (/scomplete and other global variables) The global variables are listed in Globals.h which I have put into Library.h along with all header files for this rpg.
Last edited on
You haven't declared variables dcomplete or fcomplete or scomplete.
strashko's program works
As i mentioned before the program is from the book of Mister Bjarne Stroustrup and i do not hold any rights over it. I think you don`t have any problems with the compiler ,maybe its the code itself.Can`t you get the global variables out of Globals.h or at least try #include "Globals.h" ...
Topic archived. No new replies allowed.