Computing.Net > Forums > Programming > C++ Header Problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

C++ Header Problem

Reply to Message Icon

Name: Patplays852
Date: May 2, 2009 at 12:29:02 Pacific
OS: Windows XP
CPU/Ram: 3GB
Product: Acer / T180
Subcategory: C/C++
Comment:

I am trying to create an "all inclusive" header so i only need to type #include "all.h" at the beginning of a program

As I am still learning, i only have three things in all.h atm which include:

ifndef ALL_H
define ALL_H

#include <iostream>
#include "stdafx.h"
#include <cstdlib>

endif


and in my main project i have:


#include "all.h"

int main()
{
//code
}

but when i try to compile the program i get this error:

d:\c++ projects\helloworld\helloworld\helloworld.cpp(1) : warning C4627: '#include "all.h"': skipped when looking for precompiled header use
Add directive to 'stdafx.h' or rebuild precompiled header
d:\c++ projects\helloworld\helloworld\helloworld.cpp(12) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?


it is a short file... and line 12 would be directly after the } ending the main() but nothing is there.

So, I am asking if I have my header setup right, and is it even possible to do what I am trying to do?



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: C++ Header Problem

c/c++ header wanted www.computing.net/answers/programming/cc-header-wanted/4085.html

c/c++ header wanted www.computing.net/answers/programming/cc-header-wanted/4084.html

simple C++ compile problem in Linux www.computing.net/answers/programming/simple-c-compile-problem-in-linux-/1282.html