Thread: Newbie help with header files

  1. #1
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438

    Newbie help with header files

    I'm getting an error trying to use a header file. Not knowing anything about C++ makes it pretty hard to figure out why. If anybody could help me out, I'd appreciate it.

    VehicleCollection.h
    Code:
    #ifndef VEHICLECOLLECTION_H
    #define VEHICLECOLLECTION_H
    
    class VehicleCollection
    {
        public:
            VehicleCollection();
            ~VehicleCollection(void);
    };
    
    #endif
    VehicleCollection.cpp
    Code:
    #include "VehicleCollection.h"
    
    VehicleCollection::VehicleCollection()
    {
    	
    }
    
    VehicleCollection::~VehicleCollection(void) {}
    Here's the error I get in VS.NET 2003:
    fatal error C1010: unexpected end of file while looking for precompiled header directive

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Do a search for "precompiled header"
    http://cboard.cprogramming.com/searc...searchid=31672
    Specifically, how to turn the damn thing off
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User CompiledMonkey's Avatar
    Join Date
    Feb 2002
    Location
    Richmond, VA
    Posts
    438
    Thanks for the tip! So I guess I can get rid of the "stdafx" files it starts you off with?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  2. Confusion on header and source files
    By dnguyen1022 in forum C++ Programming
    Replies: 4
    Last Post: 01-17-2009, 03:42 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. user created header files
    By MedicKth in forum C++ Programming
    Replies: 6
    Last Post: 09-20-2003, 12:36 PM