Severity Code Description Project File Line Suppression State
Error C1853 'Debug\LearnOpenGL_Shader.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa) LearnOpenGL_Shader e:\zhanghongyan\study\vs2015_projects\first_opengl\first_opengl\src\glad.c 1
翻译过来意思如下:
项目文件行抑制状态
错误调试\ LearnOpenGL_Shader C1853”。 pch'预编译头文件是来自以前版本的编译器,或者预编译头文件是c++,你正在使用它从C(或反之亦然)LearnOpenGL_Shader e:\zhanghongyan\study\vs2015_projects\first_opengl\first_opengl\src\glad.c 1
因为C是gcc编译,C++是g++编译,两者的编译方式不同。当你的工程Source Files目录下既有.c文件,又有.cpp文件时:
需要修改工程配置如下:
因为我的工程比较简单,只有几个文件,但如果工程比较大的情况下,一刀切将整个工程的预编译头文件方式全部改为不使用预编译是否合理?也百度了一些方案,有需要可参考:C语言的预编译头文件是,【编程拾遗】预编译头文件来自编译器的早期版本_李如一的博客-优快云博客