无法编译由stdafx.h引起的glsl程序

时间:2013-09-17 14:35:54

标签: c++ opengl glsl

我试图编译一个GLSL程序,但它显示了这个错误

warning C4627: '#include "Angel.h"': skipped when looking for precompiled header use
Add directive to 'stdafx.h' or rebuild precompiled header
fatal error C1010: unexpected end of file while looking for precompiled header. Did you  
forget to add '#include "stdafx.h"' to your source

但实际上我已经包含了stdafx.h并且使用带有预编译头的Visual Studio 2012创建了项目

#include "stdafx.h"
#include "Angel.h"
const int NumPoints = 5000;

//----------------------------------------------------------------------------

void
init( void )
{
    vec2 points[NumPoints];
    ...

2 个答案:

答案 0 :(得分:0)

我认为您需要转到项目属性页面 - > C / C ++ - >预编译的标题 - >将Precompiled HeaderUse(/Yu)转为Not using precompiled headers

答案 1 :(得分:0)

抱歉,这真的很有趣。无论如何,GLSL不能用C / C ++编译器编译 - GLSL编译器内置在OpenGL驱动程序中,并且它的内部结构不会暴露。您必须向OpenGL提供源代码(以文本形式),它每次都会编译它。