To clear the directory, delete the DEBUG directory. The following error occurs during compilation:
Fatal error c1083: cannot open precompiled header file:/'debug/xxx. PCH /':
No such file or directory
No way.
The error is due to the same problem:
Fatal error c1010: unexpected end of file while looking for precompiled
Header Directive
Originally, XXX. PCH is the file generated by the Pre-compiled header file. In Project-settings, select the compiled project and C/C ++ page, and select precompiled headers in the drop-down box. The following four options are available.
1. Do not use the pre-compiled header;
2. automatically use the pre-compiled header;
3. Create a pre-compiled header from the first file and specify the header file;
4. Use the pre-compiled header file stdafx. h
If the precompiled header file is stdafx. H, select 4 for all other files, 3 for stdafx. cpp, and stdafx. h for the header file.
When the first compilation error occurs, you only need to recompile stdafx. cpp to generate the pre-compiled XXX. PCH. In the second compilation problem, stdafx. h must be included at the beginning of the file.
Link error:
When a static library is used, the following error occurs:
Libcd. Lib (crt0dat. OBJ): Error lnk2005: _ cinit already defined in libcmt. Lib (crt0dat. OBJ)
Libcd. Lib (crt0dat. OBJ): Error lnk2005: _ exit already defined in libcmt. Lib (crt0dat. OBJ)
Libcd. Lib (crt0dat. OBJ): Error lnk2005: _ exit already defined in libcmt. Lib (crt0dat. OBJ)
This is a conflict between libraries and executable programs that use different libraries. On the project-settings link page of the main program, select the input item in the drop-down box,
Add:
Libc. Lib, msvcrt. Lib, mfc42.lib
For the debug version, it should be:
Libcd. Lib, msvcrtd. Lib, mfc42d. Lib.
In this case, the compilation is successful.
Similar problems:
Error lnk2001: unresolved external symbol _ afxforceexclude
This is because ignore all default libraries is selected. you can remove it.