Fatal Error C1010

This is a discussion on Fatal Error C1010 within the C++ Programming forums, part of the General Programming Boards category; Ok.... I have another problem with a different program.... I want to work on building a Kaleidoscope but I need ...

  1. #1
    Novice Programmer Pyroteh's Avatar
    Join Date
    Jan 2005
    Location
    Alaska
    Posts
    82

    Question Fatal Error C1010

    Ok.... I have another problem with a different program.... I want to work on building a Kaleidoscope but I need to get used of creating Rectangles and such but whenever I compile this program this error comes up:

    Code:
    fatal error C1010: unexpected end of file while looking for precompiled header directive
    Error executing cl.exe.
    here is the source code that I'm trying to compile:

    Code:
    #include "rect.h"
    
    RectangleShape::RectangleShape(SimpleWindow &w,
     float x, float y, color c,
     float l, float h) : Window(w),
     XCenter(x), YCenter(y), Color(c),
     Length(l), Height(h) {
    }
    
    void RectangleShape::Draw() {
    
    	const Position Center = Position(XCenter, YCenter);
    
    	Position UpperLeft = Center
    	 + Position(-(.5 * Length), -(.5 * Height));
    	Position LowerRight = Center
    	 + Position(.5 * Length, .5 * Height);
    	Window.RenderRectangle(UpperLeft, LowerRight,
    	 Color, true);
    }
    
    color RectangleShape::GetColor() const {
    	return Color;
    }
    
    void RectangleShape::GetSize(float &l,
     float &h) const {
    	l = Length;
    	h = Height;
    }
    
    void RectangleShape::GetPosition(float &x,
     float &y) const {
    	x = XCenter;
    	y = YCenter;
    }
    
    SimpleWindow& RectangleShape::GetWindow() const {
    	return Window;
    }
    
    void RectangleShape::SetColor(const color c) {
    	Color = c;
    }
    
    void RectangleShape::SetPosition(float X, float Y) {
    	XCenter = X;
    	YCenter = Y;
    }
    
    void RectangleShape::SetSize(float L, float H) {
    	Length = L;
    	Height = H;
    }
    thanks for all the help.

  2. #2
    C Programmer Stack Overflow's Avatar
    Join Date
    Apr 2004
    Posts
    477
    Hello,

    Maybe the following links can help answer your question:

    Simply, precompiled header directive problems generally stem from not including stdafx.h. Your project is expecting a precompiled header. I'm guessing that this is a Visual C++ issue. If you don't want stdafx.h, just go to Project->Settings, hit the "C/C++" tab, move the Category combo box to Precompiled Headers, and click the "Not using precompiled headers" radio button.


    - Stack Overflow
    Segmentation Fault: I am an error in which a running program attempts to access memory not allocated to it and core dumps with a segmentation violation error. This is often caused by improper usage of pointers, attempts to access a non-existent or read-only physical memory address, re-use of memory if freed within the same scope, de-referencing a null pointer, or (in C) inadvertently using a non-pointer variable as a pointer.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,642
    Do a Forum Search using "C1010" or "unexpected end of file while looking for precompiled header".

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Fatal error in fprintf
    By shoobsie in forum C Programming
    Replies: 4
    Last Post: 10-14-2005, 05:56 AM
  2. Fatal errors
    By cheeisme123 in forum C++ Programming
    Replies: 2
    Last Post: 02-06-2003, 09:03 PM
  3. Weird fatal error, header file related
    By alkis_y3k in forum C++ Programming
    Replies: 2
    Last Post: 12-26-2002, 08:54 AM
  4. fatal exception 0E
    By juhigarg in forum Windows Programming
    Replies: 3
    Last Post: 12-04-2001, 03:40 AM
  5. Fatal error :/
    By Jeremy G in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-13-2001, 07:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21