Fatal Error C1083 Cannot Open Precompiled
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company fatal error c1083 cannot open precompiled header file no such file or directory Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Fatal Error C1083 Cannot Open Source File
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers,
Fatal Error C1083 Cannot Open Include File
just like you, helping each other. Join them; it only takes a minute: Sign up How to fix .pch file missing on build? up vote 73 down vote favorite 19 When I build my c++ solution in
Fatal Error C1083 Cannot Open Compiler Generated File
Visual Studio 2008 it complains that the xxxxx.pch file is missing. Is there a setting I am missing to get the pre-compiled headers back? here is the exact error for completeness: Error 1 fatal error C1083: Cannot open precompiled header file: 'Debug\xxxxx.pch': No such file or directory c++ visual-studio-2008 share|improve this question edited May 23 '11 at 14:28 asked May 23 '11 at 11:10 Sam Mackrill 1,42842144 you have to provide more fatal error c1083 cannot open include file 'stdio.h' no such file or directory info. what error exactly are you getting? how is your project currently configured? –Assaf Lavie May 23 '11 at 11:27 Just a simple rebuild all fixed my problem. –Deqing Sep 15 at 6:57 add a comment| 6 Answers 6 active oldest votes up vote 194 down vote accepted Right-click on your project in the Solution Explorer. Click Properties at the bottom of the drop-down menu. At the top left of the Properties Pages, select All Configurations from the drop-down menu. Open the C/C++ tree and select Precompiled Headers Precompiled Header: Select Use (/Yu) Fill in the Precompiled Header File field. Standard is stdafx.h Click Okay If you do not have stdafx.h in your Header Files put it there. Edit it to #include all the headers you want precompiled. Put a file named stdafx.cpp into your project. Put #include "stdafx.h" at the top of it, and nothing else. Right-click on stdafx.cpp in Solution Explorer. Select Properties and All configurations again as in step 4 ... ... but this time select Precompiled Header Create (/Yc). This will only bind to the one file stdafx.cpp. Put #include "stdafx.h" at the very top of all your source files. (Unix or cygwin users: find . -name "*.cpp" | xargs -n1 sed -i '1s/^/#include "stdafx.h"\n/') Lucky 13. Cross your fingers and hit Build. share
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack fatal error c1083 cannot open include file 'unistd.h' no such file or directory Overflow the company Business Learn more about hiring developers or posting ads with us fatal error c1083 cannot open include file 'iostream.h' no such file or directory Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a fatal error c1083 cannot open include file 'config-win.h' no such file or directory community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up fatal error C1083: Cannot open precompiled header file up vote 0 down vote favorite I http://stackoverflow.com/questions/6096384/how-to-fix-pch-file-missing-on-build have created a win32 console project by the name of xml read. I have included and used many dll and headers #include "stdafx.h" #using
Other This item had a custom resolution. A more detailed explanation for the resolution of this particular item may https://connect.microsoft.com/VisualStudio/feedback/details/641724/automatically-recreate-a-missing-or-corrupted-precompiled-header-file have been provided in the comments section. 3 0 Sign into vote ID 641724 Comments 5 Status Closed Workarounds 0 Type Suggestion Repros 0 Opened 2/7/2011 7:33:41 AM http://2scitech.blogspot.com/2015/05/fatal-error-c1083-cannot-open.html Access Restriction Public Description Sometimes, if you cancel a build or if the compiler or linker crashes, then the precompiled header file can become corrupted. Restarting the build then produces fatal error the following output: ------ Build started: Project: YYY, Configuration: Debug Win32 ------ MyFile1.cpp d:\YYY\MyFile1.cpp(16): fatal error C1083: Cannot open precompiled header file: 'Debug\YYY.pch': No such file or directory MyFile2.cpp d:\YYY\MyFile2.cpp(16): fatal error C1083: Cannot open precompiled header file: 'Debug\YYY.pch': No such file or directory MyFile3.cpp d:\YYY\MyFile3.cpp(16): fatal error C1083: Cannot open precompiled header file: 'Debug\YYY.pch': No such file or directory ... et cetera ... fatal error c1083 et cetera Well - I got the message - the PCH file is corrupted and needs to be recreated. So what? Why do I have to tell VS to do a clean build of the affected project? Can't the compiler detect a missing or corrupted generated file itself and retrigger a clean rebuild? DETAILS ATTACH A FILE EDIT THIS ITEM Assign To Item can only be reassigned when it is active. Comments (5) | Workarounds (0) | Attachments (0) Sign in to post a comment. Please enter a comment. Submit Posted by Microsoft on 3/18/2011 at 1:15 PM Hi,I don't think this is quite the same issue as 626218. It looks to me like that issue had to do with the build system knowing to rebuild the PCH if it had been deleted. This issue has to do with the compiler recognizing a corrupt PCH and automatically regenerating it. (As far as I can tell, the fix for the other issue should appear in the next major release of Visual Studio.
an extensive explanation on how to solve it, the original thread is at this link : how-to-fix-pch-file-missing-on-build The whole problem lies in some header files needs to be already compiled so your compilation goes through. and there is some strategy for handling header files that must be precompiled as Jive Dadson explains in his answer : Right-click on your project in the Solution Explorer. Click Properties at the bottom of the drop-down menu. At the top left of the Properties Pages, select All Configurations from the drop-down menu. Open the C/C++ tree and select Precompiled Headers Precompiled Header: Select Use (/Yu) Fill in the Precompiled Header File field. Standard is stdafx.h Click Okay If you do not have stdafx.h in your Header Files put it there. Edit it to #include all the headers you want precompiled. Put a file named stdafx.cpp into your project. Put #include "stdafx.h" at the top of it, and nothing else. Right-click on stdafx.cpp in Solution Explorer. Select Properties and All configurations again as in step 4 ... ... but this time select Precompiled Header Create (/Yc). This will only bind to the one file stdafx.cpp. Put #include "stdafx.h" at the very top of all your source files. (Unix or cygwin users: find . -name "*.cpp" | xargs -n1 sed -i '1s/^/#include "stdafx.h"\n/') Lucky 13. Cross your fingers and hit Build. and this did all the magic for me :) Posted by Ahmed A. Mostafa at 2:57 PM Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest Labels: C++, Programming No comments: Post a Comment Newer Post Older Post Home Subscribe to: Post Comments (Atom) Blog Archive ▼ 2015 (3) ► October (1) ▼ May (1) fatal error C1083: Cannot open precompiled header ... ► February (1) ► 2013 (1) ► August (1) ► 2012 (5) ► July (1) ► April (1) ► March (3) About Me Ahmed A. Mostafa View my complete profile Simple template. Powered by Blogger.