【发布时间】:2020-11-20 12:15:34
【问题描述】:
我想在机器上不安装任何编译器的情况下使用 VS 代码的 C/C++ 扩展。 (我不需要编译器,因为我在 docker 容器中编译代码)。
问题:在 VS 代码的“问题”部分,我得到以下与标准 c 库相关的错误:
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (path_to_file).
cannot open source file "stdint.h" (dependency of "app.h")
任何解决方法或任何方法来禁用这些特定错误(标准库)?
附言我可以成功编译项目。
【问题讨论】:
-
C++ 的问题在于它很难正确解析,你需要一个 C++ 编译器来解决这个问题一个人.
-
@AnttiHaapala:这不仅仅是困难。我可以编写一个合理的程序,如果没有
stdint.h,您可能无法解析。具体来说,任何使用依赖于stdint.h的模板实例化的程序都无法解析。 -
code.visualstudio.com/docs/remote/containers 可以移动大部分到容器中
-
您是否考虑在您的笔记本电脑上安装Debian?
-
@BasileStarynkevitch:举个简单的例子,合理的程序可以参考
std::numeric_limits<std::intmax_t>::digits。这显然需要std::intmax_t才能查找正确的专业化。而如果你不知道std::intmax_t是一个类型,因为你缺少<cstdint>,那么你就不知道digits是一个整型常量表达式。
标签: c++ c visual-studio-code