C++ problem in best program to use

Started by
3 comments, last by Zaoshi Kaba 11 years, 5 months ago
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 #include "stdafx.h" is missing.

Can you guys explain it to me more,
Advertisement
The VS2012 project you're working on apparently has precompiled headers enabled, you can turn these off in your project's settings as they will be of little use to you right now.

I gets all your texture budgets!

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".
Dont use "stdafx.h" if your project hasn't a precompiled header
Sounds like you created wrong project type. Choose Empty Project next time, it won't have precompiled headers.

This topic is closed to new replies.

Advertisement