compiler errors - I am confused
-
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.
-
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.
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.
-
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.
-
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.
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
-
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.
-
Still confusing, Goto Project->Settings->C/C++->Precompiled Headers Select Automatic use of Precompiled Headers. Thanks. The Phantom.
-
Thanks. I fixed my problem. You say precompiled header files will speed up or slow down compile?
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?
-
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.
Very easy, add
#include "stdafx.h"
to the files that give those errors. Make sure it's the first #include though.