Sign in to follow this  

C++ problem in best program to use

Recommended Posts

Guys i am learning c++ and i have problem, the book i use to learn is c++ all in one for dummies 2nd edition, it uses code blocks and for the first program it gives a code in the console application as,

#include <iostream>
using namespace std;
int main()
cout << "Hello, I am your computer talking." << endl;
cout << 5 + 10 << end1;
return 0;

When i type in the same code in vs 2012, it shows a error that [CODE]#include "stdafx.h"[/CODE] is missing.

Can you guys explain it to me more,

Share this post

Link to post
Share on other sites
It's looking for a precompiled header which is something used to improve compile times. However, if you're just starting out you can ignore using a precompiled header. When you create a new C++ project when it shows you the a dialog that contains an "Application settings" page you can disable precompiled headers by unclicking the checkbox. Or after creating the project go to project properties and under C/C++ there should be "Precompiled headers" page. Go switch the "Precompiled header" setting to "Not Using Precompiled Headers".

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this