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. compiler errors - I am confused

compiler errors - I am confused

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
8 Posts 7 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.
  • S Offline
    S Offline
    Slaru
    wrote on last edited by
    #1

    Hi, I have a project I downloaded from cp and dont know why, but when I try to use some classes that are in many (8 0r 9) files, I get this message: *.cpp(2) : fatal error C1010: unexpected end of file while looking for precompiled header directive *.cpp I get about 10 of these when I compile. Does anyone know what this means? Where is a good place to look up compiler and linker errors? I have had this problem with classes Ive wrote before. Thanks.

    J P P A 4 Replies Last reply
    0
    • S Slaru

      Hi, I have a project I downloaded from cp and dont know why, but when I try to use some classes that are in many (8 0r 9) files, I get this message: *.cpp(2) : fatal error C1010: unexpected end of file while looking for precompiled header directive *.cpp I get about 10 of these when I compile. Does anyone know what this means? Where is a good place to look up compiler and linker errors? I have had this problem with classes Ive wrote before. Thanks.

      J Offline
      J Offline
      Joe Woodbury
      wrote on last edited by
      #2

      The best place to lookup errors is in the help. This means you are attempting to use precompiled headers, but the precompiled header is not present in the files. For Wizard generated files, this is "stdafx.h". You can turn precompiled headers off for a project in the project settings. For large projects it will slow down the compiles significantly, for small projects, the impact is negligable, though measurable.

      C 1 Reply Last reply
      0
      • S Slaru

        Hi, I have a project I downloaded from cp and dont know why, but when I try to use some classes that are in many (8 0r 9) files, I get this message: *.cpp(2) : fatal error C1010: unexpected end of file while looking for precompiled header directive *.cpp I get about 10 of these when I compile. Does anyone know what this means? Where is a good place to look up compiler and linker errors? I have had this problem with classes Ive wrote before. Thanks.

        P Offline
        P Offline
        PengFeidu
        wrote on last edited by
        #3

        Joe Woodbury have detailed it. the same you can include"stdafx.h" to solve it . dupengfei

        1 Reply Last reply
        0
        • J Joe Woodbury

          The best place to lookup errors is in the help. This means you are attempting to use precompiled headers, but the precompiled header is not present in the files. For Wizard generated files, this is "stdafx.h". You can turn precompiled headers off for a project in the project settings. For large projects it will slow down the compiles significantly, for small projects, the impact is negligable, though measurable.

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          It's also possible to turn precompiled headers off for separates files so the project compilation won't slow down too much. Right click on the .cpp file, choose settings, go in the C/C++ tab, select Precompiled headers category and choose Not using precompiled headers This is a better solution when you need to disable them only for a few files in a big project

          1 Reply Last reply
          0
          • S Slaru

            Hi, I have a project I downloaded from cp and dont know why, but when I try to use some classes that are in many (8 0r 9) files, I get this message: *.cpp(2) : fatal error C1010: unexpected end of file while looking for precompiled header directive *.cpp I get about 10 of these when I compile. Does anyone know what this means? Where is a good place to look up compiler and linker errors? I have had this problem with classes Ive wrote before. Thanks.

            P Offline
            P Offline
            Ph ntom
            wrote on last edited by
            #5

            Still confusing, Goto Project->Settings->C/C++->Precompiled Headers Select Automatic use of Precompiled Headers. Thanks. The Phantom.

            S 1 Reply Last reply
            0
            • P Ph ntom

              Still confusing, Goto Project->Settings->C/C++->Precompiled Headers Select Automatic use of Precompiled Headers. Thanks. The Phantom.

              S Offline
              S Offline
              Slaru
              wrote on last edited by
              #6

              Thanks. I fixed my problem. You say precompiled header files will speed up or slow down compile?

              D 1 Reply Last reply
              0
              • S Slaru

                Thanks. I fixed my problem. You say precompiled header files will speed up or slow down compile?

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                When the .PCH file is being created, the compile time will take longer. Subsequent compiles will be much shorter. If, however, you have a small project, the difference will not be noticeable.


                Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

                1 Reply Last reply
                0
                • S Slaru

                  Hi, I have a project I downloaded from cp and dont know why, but when I try to use some classes that are in many (8 0r 9) files, I get this message: *.cpp(2) : fatal error C1010: unexpected end of file while looking for precompiled header directive *.cpp I get about 10 of these when I compile. Does anyone know what this means? Where is a good place to look up compiler and linker errors? I have had this problem with classes Ive wrote before. Thanks.

                  A Offline
                  A Offline
                  Arthur Westerman
                  wrote on last edited by
                  #8

                  Very easy, add #include "stdafx.h" to the files that give those errors. Make sure it's the first #include though.

                  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