Project out of date

So every time I try to compile I get project out of date now i have turned off precompiled headers as another website said would work but of course it did not.

1
2
3
4
5
6
7
8
9
10
11
  #include <iostream>

void main() {
	char cContinue;
	int amount
	do {
		std::cout "Amount of money you want to take?" << std::endl;
		std::cin >> amount;
		std::cout "taken " << amount << " Please come again!" << std::endl;
		std::cout "Would you like to make another transaction (y/n)?" << std::endl;
	} while (cContinue == 'y');



Also the bulid error log:
1>------ Build started: Project: While Loop, Configuration: Debug Win32 ------
1> While Loop.cpp
1>While Loop.cpp(6): error C2143: syntax error : missing ';' before 'do'
1>While Loop.cpp(7): error C2143: syntax error : missing ';' before 'string'
1>While Loop.cpp(7): error C2563: mismatch in formal parameter list
1>While Loop.cpp(7): error C2568: '<<' : unable to resolve function overload
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(1021): could be 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=unsigned short,
1> _Traits=std::char_traits<unsigned short>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(1011): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=wchar_t,
1> _Traits=std::char_traits<wchar_t>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(1003): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(977): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1>While Loop.cpp(9): error C2143: syntax error : missing ';' before 'string'
1>While Loop.cpp(9): error C2296: '<<' : illegal, left operand has type 'const char [7]'
1>While Loop.cpp(9): error C2143: syntax error : missing ';' before 'string'
1>While Loop.cpp(9): error C2563: mismatch in formal parameter list
1>While Loop.cpp(9): error C2568: '<<' : unable to resolve function overload
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(1021): could be 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=unsigned short,
1> _Traits=std::char_traits<unsigned short>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(1011): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=wchar_t,
1> _Traits=std::char_traits<wchar_t>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(1003): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(977): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1>While Loop.cpp(10): error C2143: syntax error : missing ';' before 'string'
1>While Loop.cpp(10): error C2563: mismatch in formal parameter list
1>While Loop.cpp(10): error C2568: '<<' : unable to resolve function overload
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(1021): could be 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=unsigned short,
1> _Traits=std::char_traits<unsigned short>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(1011): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=wchar_t,
1> _Traits=std::char_traits<wchar_t>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(1003): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ostream(977): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1>While Loop.cpp(12): fatal error C1075: end of file found before the left brace '{' at 'While Loop.cpp(3)' was matched
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Last edited on
semicolont after amount in line 5
you also forgot a closing bracket for the main
WHat are you trying to do, i do not understand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>

void main() {
	char cContinue;
	int amount;
	while (cContinue == 'y'); {
		std::cout "Amount of money you want to take?" << std::endl;
		std::cin >> amount;
		std::cout "taken " << amount << " Please come again!" << std::endl;
		std::cout "Would you like to make another transaction (y/n)?" << std::endl;
std::cin >> cContinue;
	} 
}
well i was just writing an example for myself which i always do but this is a first its said project out of date

btw: that did not fix it.
Try hello world
I did that same thing but i found this:
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
Whoever told you to remove pre-compiled headers either didnt know anything, or wasnt actually trying to solve your problem.

The project goes out of date when you compile it and then edit the source. It is no problem whatsoever. ( just annoying ).

I imagine you are clicking the green arrow button, which is the a Run button, not a compile button. You click the Run button and VS says: Hey, the code is more up to date than the exe, do you want me to recompile the exe?

When I used VS there was a checkbox I could just click there to auto-answer yes.

You can also hit F7, which is the compile button. Then call run.
Last edited on
that did not work.
Just switched over to code::blocks everything works now! :)
Topic archived. No new replies allowed.