possible compiler issue

Hey guys,

I need help trying to set up a compiler on my computer. I am fairly sure the code is not the problem.

I downloaded microsoft visual studio earlier and I have been trying basically all day to try to get this thing to work.

here is my code:

# include <iostream>
using namespace std;

int main ()
{
int population;
int toilets;
double new_water;
double old_water;
double toilets_cost;
int flushes;
double old_cost;
double new_cost;
double net_amount;
double time;

cout << "Please enter the population of your city." << endl;
cin >> population;

cout << "Please enter the amount of time in number of days" << endl;
cin >> time;

toilets = population / 3;
flushes = toilets * 14;
toilets_cost = toilets * 150;
new_water = flushes * 2 * time;
old_water = flushes * 15 * time;
old_cost = old_water * .0030274;
new_cost = new_water * .0030274;
net_amount = new_water - old_water - toilets_cost;

cout << "You will save " << old_water - new_water << " gallons of water by switching to the new toilets." << endl;
cout << "You will save $" << new_water - old_water << " on water by switching to the new toilets." << endl;
cout << "You will spend $" << toilets_cost << " when buying the new toilets." << endl;
cout << "Overall, you will make $" << net_amount << " by switching to the new toilets." << endl;



return 0;
}


here is what I get when I try to build it:

1>------ Build started: Project: hw1, Configuration: Debug Win32 ------
1>Build started 9/14/2010 9:56:25 PM.
1>InitializeBuildStatus:
1> Touching "Debug\hw1.unsuccessfulbuild".
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>C:\Users\Paul\Documents\Visual Studio 2010\Projects\hw1\Debug\hw1.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.24
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


please help!!
Try re-downloading and re-installing it. This code should compile, and VC++ worked for me right out of the box, although that was years ago.

-Albatross
Does this program have problems with windows 7 64bit?

Also, does it matter where I install it?

I do not know if I need to update something with the compiler database or anything like that, but I never downloaded a library of files or anything like that.
1: It shouldn't. The compiler was made by Microsoft for a Microsoft platform, although... *chuckle*.
EDIT: OI! You downloaded the 32 bit version! In that case, yes. It might.

2: It might. I'm not sure because I'm not on that platform. Try the default directory.

3: No, re-download and re-install VC++. That's what I meant.

-Albatross
Last edited on
Topic archived. No new replies allowed.