Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jun 9th, 2006, 9:33 PM   #1
aron_h
Newbie
 
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0 aron_h is on a distinguished road
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;
}
this USED to work without errors, but for some reason suddenly this format gives me the error that suggests "Did you forget to add '#include "stdafx.h"' to your source?"

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.
aron_h is offline   Reply With Quote
Old Jun 9th, 2006, 10:33 PM   #2
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
Did you change compilers? Did you change any settings on your compiler? Things don't just stop working without there being a trigger.
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
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!
jayme is offline   Reply With Quote
Old Jun 9th, 2006, 10:50 PM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Jun 9th, 2006, 10:55 PM   #4
aron_h
Newbie
 
Join Date: Jun 2006
Location: Canada
Posts: 8
Rep Power: 0 aron_h is on a distinguished road
i see, i found the empty project. i guess empty project is the best way to go then.
aron_h is offline   Reply With Quote
Old Jun 9th, 2006, 11:21 PM   #5
jayme
Professional Programmer
 
jayme's Avatar
 
Join Date: Nov 2005
Location: Canada
Posts: 495
Rep Power: 0 jayme is an unknown quantity at this point
Send a message via MSN to jayme
Or switch to code::blocks...
__________________

Quote:
Originally Posted by Mohamed Jihad
Durka durka!
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!
jayme is offline   Reply With Quote
Old Jun 10th, 2006, 1:35 AM   #6
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 6 bl00dninja is on a distinguished road
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.
bl00dninja is offline   Reply With Quote
Old Jun 10th, 2006, 2:00 AM   #7
Harakim
Hobbyist Programmer
 
Join Date: May 2006
Location: West Jordan, Utah, United States
Posts: 176
Rep Power: 3 Harakim is on a distinguished road
I guess I pretty much have to try code::blocks now since so many people are talking about it.
Harakim is offline   Reply With Quote
Old Jun 10th, 2006, 2:58 AM   #8
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3 Jimbo is on a distinguished road
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...
Jimbo is offline   Reply With Quote
Old Jun 10th, 2006, 3:56 AM   #9
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,260
Rep Power: 5 grumpy will become famous soon enough
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.
grumpy is offline   Reply With Quote
Old Jun 10th, 2006, 5:08 AM   #10
splinter9x
Hobbyist Programmer
 
splinter9x's Avatar
 
Join Date: Jun 2006
Posts: 137
Rep Power: 0 splinter9x is an unknown quantity at this point
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.
__________________
Visit my Blog
I support WINDOWS...
splinter9x is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:48 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC