Rename "glew.c" to "glew.cpp" so we can use C++ PCH. Surround "glew.cpp" with: /******************************************************************************/ #include "stdafx.h" /******************************************************************************/ #if !defined(DX9) && !defined(DX10) /******************************************************************************/ .. /******************************************************************************/ #endif /******************************************************************************/ Files come from OpenGL Extension Libraries: GLEW - http://glew.sourceforge.net/