IntelliSense complains about standard types when using precompiled headers
See original GitHub issueBrief Issue Summary
IntelliSense starts to complain about all standard things when I’m using target_precompile_headers()
, e.g. std::size_t: "namespace "std" has no member "size_t""
. The project itself builds just fine.
Code structure:
//./project/src/common.h
#include <vector>
//etc.
//./project/src/main.cpp
#include "common.h"
//use std::vector...
CMake structure:
# ./project/CMakeLists.txt:
# some global settings like project(), etc.
add_subdirectory(src)
# ./project/src/CMakeLists.txt
add_executable(project)
target_sources(project
PRIVATE
main.cpp
common.h)
target_precompile_headers(project
PRIVATE
"common.h"
)
Without target_precompile_headers()
everything is OK.
Platform and Versions
- Operating System: Ubuntu 18.04
- CMake Version: 3.16
- VSCode Version: 1.43.2
- CMake Tools Extension Version: 1.3.1
- Compiler/Toolchain: GCC 9.2.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:6 (4 by maintainers)
Top Results From Across the Web
intellisense errors when using visual studio force include
I am experiencing an issue when I attempt to use the visual studio option force include (/FI) with a precompiled header file. When...
Read more >Known issues with IntelliSense for C++20 modules
IntelliSense not working in some files when using C++20 modules. Intellisense is extremely slow with c++20 modules and large precompiled headers.
Read more >Did you abandon headers for modules? Why/Why not? : r/cpp
MSVC supports them, but intellisense does not fully support them. So if you use Visual Studio (which is common if you use MSVC)...
Read more >Healthy Lifestyle Score items - Menzies Institute for Medical ...
IntelliSense complains about standard types when using precompiled headers bug Feature: cpptools integration more info needed. #1141 opened Mar 25, ...
Read more >Intellisense stops working when forced include multiple headers
When I forced include a precompiled header on a source file followed by a few other stable headers that don't need to be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I reproduce now, thanks for the small project.
I believe it was fixed in 1.11.25 with this PR where we started forwarding the compiler options to cpptools for parsing instead of doing it ourselves: https://github.com/microsoft/vscode-cmake-tools/pull/2563