![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0
![]() |
forgot to #include stdafx.h???
ok i'm brand new with C++, so i really don't know anything at all.
i'm studying a book on it, and for a while i have been able to get by with just including iostream and string #include <iostream>
#include <string>
using namespace std;
int main()
{
cout << "whatever" << endl;
return 0;
}i never had to #include <stdafx.h> before, and indeed my code WILL work if i do include it, but what i want to know is why suddenly i'm obligated to use it? it's just a pain to me. |
|
|
|
|
|
#2 | |
|
Professional Programmer
|
Did you change compilers? Did you change any settings on your compiler? Things don't just stop working without there being a trigger.
__________________
▄▄▄▄ Quote:
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it. Download Code::Blocks now! ▄▄▄▄ |
|
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You just need to change your compiler settings to not precompile headers. When you set up your project, set up an "empty" project and you'll automatically get the precompiled headers off. It's an MS thangy. At this point, you can just go into compiler options and turn them off. If you have problems finding where, just post back and I'll give you a trail.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0
![]() |
i see, i found the empty project. i guess empty project is the best way to go then.
|
|
|
|
|
|
#5 | |
|
Professional Programmer
|
Or switch to code::blocks...
__________________
▄▄▄▄ Quote:
Due to incorrect calculations during the middle ages, our calendar actually begins a few years after Jesus' birth. Thus the real 6/6/6 happened a few years back. The world already ended and you missed it. Download Code::Blocks now! ▄▄▄▄ |
|
|
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 6
![]() |
code::blocks is a great free IDE, but why would you decide to quit using an industrial-strength application development tool to use a shareware one instead?
i have both, i ususally use MS VS. that doesn't mean the other is bad, but would you try to race a stock car with an automatic transmission just because you didn't want to learn to drive a stick?
__________________
i put on my robe and wizard hat... Have you ever heard of Plato, Aristotle, Socrates?...Morons. |
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3
![]() |
I guess I pretty much have to try code::blocks now since so many people are talking about it.
|
|
|
|
|
|
#8 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 769
Rep Power: 3
![]() |
Could people do me a favor and not suggest switching IDEs anytime someone doesn't know some nuance to the one they're currently using? Especially when another poster has addressed the issue... We've had a few threads about "I don't know how to do this or that" and people seem to jump at changing IDEs instead of letting the OP learn how to use what they've already got.
Sorry for sounding upset, but this has started bugging me... |
|
|
|
|
|
#9 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,254
Rep Power: 5
![]() |
Indeed. No IDE is perfect (and, even if it was, one mans perfection is another mans horror story) and it is usually easier to tweak most IDEs to solve a problem than it is to install and learn to use a new one.
I suppose, when someone has a problem with settings of code::blocks, that they will be inundated with suggestions to install some other IDE. |
|
|
|
|
|
#10 |
|
Hobbyist Programmer
Join Date: Jun 2006
Posts: 137
Rep Power: 0
![]() |
I have tried code::blocks and Dev-C++ and I personally prefer, even though it seems as if it is not being developed anymore I still like Dev-C++. But you guys have a point. Switching IDE's is no way to fix a problem. Just figure out how to fix the problem in the IDE that you are using.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|