8 Replies - 2964 Views - Last Post: 27 June 2011 - 08:16 AM Rate Topic: -----

#1 byrandomby1  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 124
  • Joined: 08-March 11

visual studio c++ console print?

Posted 24 June 2011 - 01:41 AM

Using visual studio ultimate 2010 C++
win32 console application.

int main()
{
	std::cout << "Hello world!" << std::endl;
	return 0;
}


I followed a tutorial.
And when I compile it there's an error.

This post has been edited by JackOfAllTrades: 24 June 2011 - 03:08 AM
Reason for edit:: Added code tags

Is This A Good Question/Topic? 0
  • +

Replies To: visual studio c++ console print?

#2 Aphex19  Icon User is offline

  • Born again Pastafarian.
  • member icon

Reputation: 614
  • View blog
  • Posts: 1,873
  • Joined: 02-August 09

Re: visual studio c++ console print?

Posted 24 June 2011 - 02:22 AM

Try including iostream

#include <iostream>


Be sure to post the errors if that's not the answer though.

This post has been edited by Aphex19: 24 June 2011 - 02:26 AM

Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5954
  • View blog
  • Posts: 23,222
  • Joined: 23-August 08

Re: visual studio c++ console print?

Posted 24 June 2011 - 03:08 AM

WHAT'S THE ERROR????
Was This Post Helpful? 0
  • +
  • -

#4 byrandomby1  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 124
  • Joined: 08-March 11

Re: visual studio c++ console print?

Posted 27 June 2011 - 01:49 AM

#include <iostream>

using namespace std;

int main(){

	return 0;
}



Error 1 error C1083: Cannot open include file: 'iostream': No such file or directory


2 IntelliSense: cannot open source file "iostream"

3 IntelliSense: name must be a namespace name
Was This Post Helpful? 0
  • +
  • -

#5 byrandomby1  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 124
  • Joined: 08-March 11

Re: visual studio c++ console print?

Posted 27 June 2011 - 02:16 AM

The problem only happens with visual studio ultimate.

I tried using visual C++ express. Works well.
Was This Post Helpful? 0
  • +
  • -

#6 jimblumberg  Icon User is offline

  • member icon


Reputation: 3845
  • View blog
  • Posts: 11,751
  • Joined: 25-December 09

Re: visual studio c++ console print?

Posted 27 June 2011 - 06:10 AM

What is the compiler version number for both products?

Jim
Was This Post Helpful? 0
  • +
  • -

#7 byrandomby1  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 124
  • Joined: 08-March 11

Re: visual studio c++ console print?

Posted 27 June 2011 - 07:27 AM

Both latest version.
Was This Post Helpful? 0
  • +
  • -

#8 jimblumberg  Icon User is offline

  • member icon


Reputation: 3845
  • View blog
  • Posts: 11,751
  • Joined: 25-December 09

Re: visual studio c++ console print?

Posted 27 June 2011 - 07:59 AM

Check the settings on ultimate and insure that it is set to compile as c++.

Also what is the name of the file you are trying to compile (primarily the extension)?

Jim
Was This Post Helpful? 1
  • +
  • -

#9 byrandomby1  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 124
  • Joined: 08-March 11

Re: visual studio c++ console print?

Posted 27 June 2011 - 08:16 AM

Somehow it works now.. Thanks anyway.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1