By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,433 Members | 1,470 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,433 IT Pros & Developers. It's quick & easy.

Compiler giving errors on iosfwd file.

P: 6
My 1st program in C++....

Unexpected errors come up and all to do with the header.....

Plz help me... :(
Attached Images
File Type: jpg 2004962346498549149_rs.jpg (89.8 KB, 802 views)
May 30 '07 #1
Share this Question
Share on Google+
14 Replies


gpraghuram
Expert 100+
P: 1,275
HI,
Explain the problem more clearly or post the code where u are facing the issue.

Raghuram
May 30 '07 #2

Expert 100+
P: 181

My 1st program in C++....

Unexpected errors come up and all to do with the header.....

Plz help me... :(
Did u create and empty project and solution before adding your files. what are the other files in ur solution
May 30 '07 #3

P: 6
That's all I got. A .cpp. That's it. And all the code is just that.

I know C,now I want to do C++ and it's just give random errors when trying to compile. As far as I'm concerned... my code is fine... isn't that right???
May 30 '07 #4

Banfa
Expert Mod 5K+
P: 8,916
In future please take the trouble to copy and paste the code and errors as text into you message rather than pasting a screen shot.

The problem is not in your code it is in the header iosfwd which is presumably included through iostream.

Check your compile options to make sure they are correct, pay particular attention to the precompiled header options.
May 30 '07 #5

sicarie
Expert Mod 2.5K+
P: 4,677
Hey guys-

I changed the thread title to (hopefully) better describe the issue, let me know if you think it should be different.
May 30 '07 #6

P: 6
In future please take the trouble to copy and paste the code and errors as text into you message rather than pasting a screen shot.

The problem is not in your code it is in the header iosfwd which is presumably included through iostream.

Check your compile options to make sure they are correct, pay particular attention to the precompiled header options.
Thx, but can you be more specific??? I don't really know where to find the options.....

The code in text

#include <iostream>
using namespace std;
int main()
{
cout<<"Hello"<<endl;
return 0;
}

Here are the error in text...

Error 1 error C2146: syntax error : missing ';' before identifier '_Fpz' c:\program files\microsoft visual studio 8\vc\include\iosfwd 34
Error 2 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\include\iosfwd 34
Error 3 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\include\iosfwd 34
Error 4 error C2061: syntax error : identifier 'fpos_t' c:\program files\microsoft visual studio 8\vc\include\iosfwd 50
Error 5 error C2146: syntax error : missing ';' before identifier 'seekpos' c:\program files\microsoft visual studio 8\vc\include\iosfwd 65
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\include\iosfwd 65
Error 7 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\include\iosfwd 66
Warning 8 warning C4183: 'seekpos': missing return type; assumed to be a member function returning 'int' c:\program files\microsoft visual studio 8\vc\include\iosfwd 68
Error 9 error C2146: syntax error : missing ';' before identifier '_Fpos' c:\program files\microsoft visual studio 8\vc\include\iosfwd 117
Error 10 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\include\iosfwd 117
Error 11 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files\microsoft visual studio 8\vc\include\iosfwd 117
Error 12 error C2065: 'EOF' : undeclared identifier c:\program files\microsoft visual studio 8\vc\include\iosfwd 510

Thx again...
May 30 '07 #7

Expert 100+
P: 181
That's all I got. A .cpp. That's it. And all the code is just that.

I know C,now I want to do C++ and it's just give random errors when trying to compile. As far as I'm concerned... my code is fine... isn't that right???
did u create solution and empty project for this code?
May 31 '07 #8

P: 6
Yes it's an empty project.
May 31 '07 #9

Savage
Expert 100+
P: 1,764
Yes it's an empty project.
Project->Options->Compiler tab

On the upper right part of the options frame u will see Pre-compiled headers

Savage
May 31 '07 #10

P: 6
What do I change it to???
May 31 '07 #11

Savage
Expert 100+
P: 1,764
What do I change it to???
What's currently selected?

Savage
May 31 '07 #12

P: 6
It's "Non Using Precompiled Headers" There are options..... Create precompiled headers, Use precompiled headers, <inherit from parent or project default>

Which one do I select?
Jun 21 '07 #13

weaknessforcats
Expert Mod 5K+
P: 9,197
There are no bugs in your code.

Did you do this:
1) Create a C++ Win32 Project
2) When rthe wizard appeared you did not click Finish but instead clicked Application Settings
3) then you selected a) console application and b) empty project
4) then you clicked Finish.
5) then you ADDED a .cpp file to the project

If you didn't do this exactly, your project and .cpp file are not set up correctly.

Be sure you didn't confuse C++ with C#.

Normally, you don't get a .cpp file by creating a project. You create a project and then ADD a cpp file to the project.

Your attachment does not show the Solution Explorer so I can't tell if the .cpp file is part of your project.
Jun 21 '07 #14

Expert 100+
P: 181
Please check this link from msdn. This might help you to create a new project and solution / workspace for your .cpp file

http://msdn2.microsoft.com/en-us/lib...yc(VS.80).aspx
Jun 21 '07 #15

Post your reply

Sign in to post your reply or Sign up for a free account.