So some reason, my.cpp file is usually lacking it't header file. But I feel not including the header file anyplace else. I just started so I examined all the documents I produced
Error: Can not open file as archive Forum: Help. Creator: Christoph. (It's the result of a long list of private data). When I try to test the file, I got 'it's not possible to open file as archive' information. I just use the GUI, so I don't know how to retrieve the information about the first and last bytes in hex. Some styles failed to.
enginuity.h
enginuity.cpp
primary.cpp
dont find out what's going on. The mistake I obtain is definitely
Billy ONeal73.5k3737 gold badges268268 silver badges494494 bronze badges
statistical25numerical254,7782424 gold badges113113 metallic badges190190 bronze badges
10 Answers
Do you read the error information?
fatal error M1010: unexpected end of file while looking for precompiled header. Do you forget to add '#include 'stdafx.l' to your supply?
I don't observe an
Billy ONealBilly ONeal#consist of 'stdafx.h'
in enginuity.cpp. ;) If you're making use of precompiled headers, you require to consist of the precompiled header ineveryresource (.cpp) file.73.5k3737 yellow metal badges268268 magic badges494494 bronze badges
I just experienced this mistake when including stdafx.l in a cpp file located in a parent folder above where stdafx.l will be.
causes the compile mistake.Changing it to:
corrects the compile error, but then intellisense freaks away.
The 'repair' for intellisense, according to somebody at Microsoft here, will be to include '$(ProjectDir)' (or wherever the stdafx.l is certainly) to the checklist of web directories under Project-gt;Properties-gt;Construction Propertes-gt;C/C-gt;General-gt;Additional Include Web directories.
I've tested this works in Visible Recording studio 2012. Should function in 2010 as nicely.
Gordon GlasGordon Glas1,54222 gold badges1414 silver precious metal badges2222 bronze badges
You'll either wish to put the line
at the top of all your.cpp documents (in this case, enenuity.cpp is the only one lacking it.
or disable precompiled headers in your project.
If you possess precompiled headers allowed in your project, Visual G will look for that
JohnMcGJohnMcG#consist of
directive at the best of all your supply data files. If it't not generally there, you'll get the negative commentary you obtained.6,84844 silver badges3333 gold badges4646 bronze badges
IF APPROVED Option Will NOT Function FOR YOU:
In my case the stdafx.l include had been after various other includes in my.cpp file.
Placing the #include 'stdafx.h' declaration at the TOP of the.cpp file fixed my mistakes.
ViktorViktor
Your header file,
Thomas MatthewsThomas Matthewsenginuity.h
is definitely lacking a#endif
, or is generally there a mistake in the publishing?45.2k1111 magic badges7676 magic badges124124 bronze badges
It is usually possible to disable precompiled headers for a solitary file (VS2010). Choose the.cc or even.cpp file that is certainly leading to the annoyance, correct mouse menus, qualities, precompiled headers ,Precompiled Header (transformation to) Not Making use of Precompiled Headers.
user1577802consumer1577802
Instead of incorporating #include 'stdafx.l' to each.cpp file, you can use the Forced Include File feature. The function is recorded right here: https://msdn.microsoft.com/en-us/library/8c5ztk84.aspx.
In my case, I had been attempting to put together present.cpp data files from another task in a brand-new task. I understood that I shouldn't have to modify each file because the original project acquired precompiled headers enabled and it had been somehow compiling the same files effectively. I found out that this choice was set up in the first project, and the mistake went away after I made the exact same construction in the brand-new project.
wonderlrwonderlr
Include #consist of 'stdafx.l' to the best of enginuity.cpp or disable precompiled headers in your project.
GeorgeGeorge1,78011 yellow metal logo1313 sterling silver badges1111 bronze badges
This error will take place if you possess two solutions in a subdirectory of a task and precompiled headers are usually allowed. I have experienced the exact same problem and Microsoft provides not fixed it yet.
The microsoft work around occasionally works.
HaltingStateHaltingState93011 silver logo1212 metallic badges2222 bronze badges
As Viktor mentioned above like stdafx.laftervarious other includes will furthermore result in this mistake and can occur quite simply if you make use of the Add Function Wizard. In my case, the sorcerer added the #include to the trop of the cpp file (despite that it had been already integrated) so I ended up with (using this example)
Aurélien Ooms3,87633 yellow metal badges1515 silver precious metal badges2727 bronze badges
Michael jordan L.Jordan M.