Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. add file to project problem.

add file to project problem.

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionc++announcementworkspace
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vu Nguyen
    wrote on last edited by
    #1

    Hi all! I made a dialog base application and wanted to use a class I wrote before. I copied the header file and the implementation file to the project folder and use "add files to project" option to add these 2 files. These 2 files are actually working files. However, when I tried to recompile the project, it kept giving me this error. ------Configuration: MyProject - Win32 Release---------- Compiling... controllerList.cpp D:\MyProject\MyPoint.cpp(188) : fatal error C1010: unexpected end of file while looking for precompiled header directive Error executing cl.exe. Does any one know what is wrong here? Thank You Vu The class is very simple. If you need to have a look, here it is: //--------------------- myPoint.h //--------------------- #ifndef MYPOINT_H #define MYPOINT_H class MyPoint { private: int x,y; public: MyPoint(); ~MyPoint(); void setPoint(int,int); int getX(); int getY(); }; #endif //--------------------- myPoint.cpp //--------------------- #include "MyPoint.h" MyPoint::MyPoint() { x= 0; y=0; } MyPoint::~MyPoint() { x=-1; y=-1; } int MyPoint::getX() { return x; } int MyPoint::getY() { return y; } void MyPoint::setPoint(int x1,int y1) { x= x1; y = y1; } vucsuf

    N L 2 Replies Last reply
    0
    • V Vu Nguyen

      Hi all! I made a dialog base application and wanted to use a class I wrote before. I copied the header file and the implementation file to the project folder and use "add files to project" option to add these 2 files. These 2 files are actually working files. However, when I tried to recompile the project, it kept giving me this error. ------Configuration: MyProject - Win32 Release---------- Compiling... controllerList.cpp D:\MyProject\MyPoint.cpp(188) : fatal error C1010: unexpected end of file while looking for precompiled header directive Error executing cl.exe. Does any one know what is wrong here? Thank You Vu The class is very simple. If you need to have a look, here it is: //--------------------- myPoint.h //--------------------- #ifndef MYPOINT_H #define MYPOINT_H class MyPoint { private: int x,y; public: MyPoint(); ~MyPoint(); void setPoint(int,int); int getX(); int getY(); }; #endif //--------------------- myPoint.cpp //--------------------- #include "MyPoint.h" MyPoint::MyPoint() { x= 0; y=0; } MyPoint::~MyPoint() { x=-1; y=-1; } int MyPoint::getX() { return x; } int MyPoint::getY() { return y; } void MyPoint::setPoint(int x1,int y1) { x= x1; y = y1; } vucsuf

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      Add #include "stdafx.h" to the top of your file Nish

      1 Reply Last reply
      0
      • V Vu Nguyen

        Hi all! I made a dialog base application and wanted to use a class I wrote before. I copied the header file and the implementation file to the project folder and use "add files to project" option to add these 2 files. These 2 files are actually working files. However, when I tried to recompile the project, it kept giving me this error. ------Configuration: MyProject - Win32 Release---------- Compiling... controllerList.cpp D:\MyProject\MyPoint.cpp(188) : fatal error C1010: unexpected end of file while looking for precompiled header directive Error executing cl.exe. Does any one know what is wrong here? Thank You Vu The class is very simple. If you need to have a look, here it is: //--------------------- myPoint.h //--------------------- #ifndef MYPOINT_H #define MYPOINT_H class MyPoint { private: int x,y; public: MyPoint(); ~MyPoint(); void setPoint(int,int); int getX(); int getY(); }; #endif //--------------------- myPoint.cpp //--------------------- #include "MyPoint.h" MyPoint::MyPoint() { x= 0; y=0; } MyPoint::~MyPoint() { x=-1; y=-1; } int MyPoint::getX() { return x; } int MyPoint::getY() { return y; } void MyPoint::setPoint(int x1,int y1) { x= x1; y = y1; } vucsuf

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Vu You have to either turn off use of precompiled headers or enable your class to use precompiled headers. To turn off Precompiled Headers got to the menu. Select Project -> Settings..., select the C/C++ tab. Select Precompiled Headers from the dropdown combobox. Here you select Not using precompiled headers. To enable your class to use Precompiled Headers add

        #include "stdafx.h"

        to the top off you classes header file before all other #include statements. Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone

        S 1 Reply Last reply
        0
        • L Lost User

          Vu You have to either turn off use of precompiled headers or enable your class to use precompiled headers. To turn off Precompiled Headers got to the menu. Select Project -> Settings..., select the C/C++ tab. Select Precompiled Headers from the dropdown combobox. Here you select Not using precompiled headers. To enable your class to use Precompiled Headers add

          #include "stdafx.h"

          to the top off you classes header file before all other #include statements. Michael Martin Pegasystems Pty Ltd Australia martm@pegasystems.com +61 413-004-018 "Don't belong. Never join. Think for yourself. Peace" - Victor Stone

          S Offline
          S Offline
          solex
          wrote on last edited by
          #4

          Just do a Rebuild all after having added StdAFX.h A vast majority of our imports comes from outside the country. George W. Bush

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups