Produces warnings when importing custom header files:PCH Warning: header stop not at file scope
The editor is VSCode, the compiler is g++11
IntelliSense, and the code checker (that is, the one that reports the error) is IntelliSense.
The specific reason is: the syntax of c++17 is used in the code, which does not match the configuration of IntelliSense, and IntelliSense cannot recognize the syntax of the header file during precompilation.
According to the error message, find the relevant configuration of IntelliSense, because there are multiple c++ compilers on the computer, but there is no corresponding configuration when using IntelliSense. As can be seen the compiler used is clang
not actually used g++11
.
Modify the compiler configuration and add parameters -std=c++17
to make the precompilation of IntelliSense work normally, indicating that the syntax of c++17 is used.
Or do not add parameters -std=c++17
, there is a configuration below that can modify the c++ standard used, and it can also work normally if it is changed to c++17.
Read More:
- [Solved] Android MediaRecorder.stop() Error: java.lang.RuntimeException: stop failed.
- ApplicationContext.xml file header error Referenced file contains errors
- VSCode Unable to find custom header file directory: fatal error: no such file or directory
- How to Solve Error:‘itoa’ was not declared in this scope
- Mac Vscode C++ Customize Header File Error: linker command failed
- [Solved] error: ‘CV_GRAY2BGR’ was not declared in this scope
- Tomcat Error parsing HTTP request header Note: further occurrences of HTTP header parsing errors
- [Solved] error: ‘xcb_generic_event_t’ was not declared in this scope
- [Solved] fatal error: bits/libc-header-start.h: No such file or directory
- [Solved] MIT cheetah make error: ‘ioctl’ was not declared in this scope
- docker load Error processing tar file(exit status 1): archive/tar: invalid tar header
- Compile .h file with error “error: backslash-newline at end of file [-Werror]:
- JSP web.xml file header web app error [How to Solve]
- [Solved] Adb Shell Monkey Warning: can‘t create log.txt, Read-only file system
- [Solved] Error(22) WARNING: IPv4 forwarding is disabled. Networking will not work.
- [Solved] Mac Runjmeter WARNING: package sun.awt.X11 not in java.desktop
- [How to Solve] java.lang.IllegalArgumentException: Request header is too large
- [Solved] AS Warning: String literal in setText can not be translated. Use Android resources instead.
- Rabbitmq failed to stop normally: ERROR: node with name “rabbit” already running on “localhost”