Home > Fatal Error > Fatal Error C1010 Stdafx.h

Fatal Error C1010 Stdafx.h

But what to do when different files use somewhat similar but still different sets of headers? In the field "Forced Included File" write the following text: StdAfx.h;%(ForcedIncludeFiles) From now on, "stdafx.h" will be automatically included in the beginning of ALL the files to be compiled. up vote 12 down vote favorite 4 I compile the following code but I get a compile error in Visual Studio that I cannot understand. #include using namespace std; int One of them is created after compiling the C-file (xx.c), the other after compiling the C++-file (yy.cpp). http://bashprofile.net/fatal-error/fatal-error-c1010-include-stdafx-h.html

CString GetPathToSelf() { HMODULE hmod = GetModuleHandle(NULL); char lpszFilename[512]; GetModuleFileName(hmod, lpszFilename, 512); CString path = lpszFilename; retupath; } ///////////////////////////////////////////////////////////// //Gets the path to the pdf995 folder. To save time, the compiler tries to precompile most of these header files, and use the predigested data instead of reading through all of these header files on every compilation. Hot Network Questions A better way to evaluate a certain determinant Can a Legendary monster ignore a diviner's Portent and choose to pass the save anyway? To solve the problem, compile the entire solution, or at least the stdafx.cpp file. http://stackoverflow.com/questions/20113280/fatal-error-c1010-stdafx-h-in-visual-studio-how-can-this-be-corrected

Search Engine Optimisation provided by DragonByte SEO v2.0.32 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd. You will get window with your file's properties. How to mount a disk image from the command line? Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 09-22-2008 #1 paushali View Profile View Forum Posts

Several precompiled headers For what may we need several precompiled headers, in one project? Browse other questions tagged c++ visual-studio compiler-construction header or ask your own question. Fatal error C1853: 'project.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa) If you didn't use the precompiled headers option in your project, let's find out how to enable it.

Removing elements from an array that are in another array Exploded Suffixes How to solve the old 'gun on a spaceship' problem? Please don't PM me for help - and no, I don't do help over instant messengers. 09-22-2008 #5 Mario F. To find out how to do it correctly, see the above section "How to use precompiled headers". What are some examples of the new errors that showed up?

Using VS2013, trying to create the app that is in the document titled "How to Use the Face Detection Module" Created a new project, typed in the code exactly as it char szprocesspdf[1024]; CString szDefaultProcessPDF; GetPrivateProfileString(TEXT('Parameters'),TEXT('ProcessPDF'), '', szprocesspdf, sizeof(szprocesspdf), GetPdf995Path() + 'pdf995\\res\\pdf995.ini'); szDefaultProcessPDF = szprocesspdf; WritePrivateProfileString(TEXT('Parameters'),TEXT('ProcessPDF'), GetPathToSelf() + ' deleteflag', GetPdf995Path() + 'pdf995\\res\\pdf995.ini'); HANDLE hndFlag = CreateFile(GetPdf995Path() + 'pdf995\\flag', GENERIC_WRITE, 0, NULL, Developing web applications for long lifespan (20+ years) This riddle could be extremely useful Is intelligence the "natural" product of evolution? Therefore, what will be the final solution on building c++ codes that will be able to compile and build both visual studio .net and UNIX without modifying the source? cman's

  • Thanks!
  • Originally Posted by Salem You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.
  • Don't forget to remove the include.
  • How do I explain that this is a terrible idea?
  • Therac-25: Quick-and-Dirty Program code started using machines to kill people as early as in 1985.
  • share|improve this answer answered Aug 31 '11 at 18:40 Michael Burr 240k31353574 According to msdn.microsoft.com/en-us/library/ms235516%28v=VS.100%29.aspx‌, the Empty Project template is in Express.

[email protected] Contact Us Русский English Collected Errors: Checked Projects: 42 tips on C++: Read PVS-Studio Static Code Analyzer for C, C++ and C# Product page Documentation Troubleshooting FAQ Download and try Third-party libraries included into the project as source files cause some additional troubles. When i created my console application, VS automatically puts a #include "stdafx." directive at the top of the main file. The amount of work the preprocessor has to do during project compilation can be greatly reduced.

CornedBee "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - http://bashprofile.net/fatal-error/fatal-error-c1010-unexpected-end-of-file.html What OS? Is it possible to have a planet unsuitable for agriculture? Now you can't just insert a preprocessed text, as the entire mechanism of "precompiled headers" gets broken.

Does the recent news of "ten times more galaxies" imply that there is substantially more mass? Important rule. This file also needs to be included before any other code in your source files using #include "stdafx.h". (This header file is specified as Create/Use PCH Through File project property) Show: his comment is here With the passing of Thai King Bhumibol, are there any customs/etiquette as a traveler I should be aware of?

It will make the situation undefined, as we have changed the contents of all the files where "bool" is mentioned. The first one should be generated from stdafx_cpp.cpp, stdafx_cpp.h; the second from stdafx_c.c, stdafx_c.h. Create an stdafx.cpp file, and add it into the project.

This method is not a universal one, but it did help me in many cases.

Please don't PM me for help - and no, I don't do help over instant messengers. 09-22-2008 #3 paushali View Profile View Forum Posts Visit Homepage Registered User Join Date Aug Check your code too. The *.pch file may be pretty large, which depends on how many headers are expanded in it. When compiling each source (.cpp) file, the compiler skips through the source code, looking for the directive: #include "stdafx.h" Once it finds this directive, it substitutes the precompiled header information and

sabapathy 2005-12-13, 12:18:14 cman from United States What if I am trying to compile c code? 2005-12-13, 12:29:50 cman from United States If you're using a C++ project that You can't use a shared *.pch file for them - the compiler will generate an error. Could any one tell me what's the reason behind and how to fix the problem? weblink Thank you for all your help in advance.

However, one project may contain a few different precompiled headers. If I include 'stdafx.h' in the source file, UNIX's gcc compiler doesn't have that file. This problem is common with Visual Studio newcomers trying to use precompiled headers in their project for the first time.