Jump to content
  • Advertisement
Sign in to follow this  
Bradpm

Visual Studio 2008 Problem

This topic is 3553 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, i am a beginner learning C++ It has become apperant that there is a compiling problem with the #include <iostream> i tried both of the following and the errors that i got are with them. #include <iostream.h> fatal error C1083: Cannot open include file: 'iostream.h' #include <iostream> error C2447: '{' : missing function header (old-style formal list?) Any Help?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Bradpm
Hey guys, i am a beginner learning C++

It has become apperant that there is a compiling problem with the #include <iostream> i tried both of the following and the errors that i got are with them.

#include <iostream.h>

fatal error C1083: Cannot open include file: 'iostream.h'

#include <iostream>

error C2447: '{' : missing function header (old-style formal list?)

Any Help?

#include <iostream> is correct. Can we see your code?

Share this post


Link to post
Share on other sites
Quote:
Original post by Bradpm
1: #include <iostream>
2:
3:
4: int main();
5: {
6: cout <<"Hello World!\n";
7: return 0;
8: }
You don't want a semicolon at the end of line 4 there. That's what the error is referring to (Somewhat cryptically)

Share this post


Link to post
Share on other sites
I removed it and now i get 2 errors :S

error C2447: '{' : missing function header (old-style formal list?)
error C2065: 'cout' : undeclared identifier

Share this post


Link to post
Share on other sites
That worked :)

Just that one error left haha :)

error C2447: '{' : missing function header (old-style formal list?)

Here is the code:

#include <iostream>


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

Share this post


Link to post
Share on other sites
Quote:
Original post by Bradpm
That worked :)

Just that one error left haha :)

error C2447: '{' : missing function header (old-style formal list?)

Here is the code:

#include <iostream>


int main()
{
std::cout <<"Hello World!\n";
return 0;
}
What line does the error refer to? Are you sure that's your exact code?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!