# Why cant I use #include after upgrading my driver

After updating my graphics driver and trying to run this example from John Chapman's blog I got this error

Vertex shader failed to compile with the following errors:
ERROR: 0:8: error(#105) #version must occur before any other program statement


The way that the version is defined is by including a file containing this code

#ifndef DEF_GLSL_
#define DEF_GLSL_

#version 420

...


So inside all other shader files one can see that the first line is as follows

#include "common/def.glsl"
...


I remember this working perfectly a few months ago. So what exactly has changed and the #include command is no longer valid?

• There are a lot of code snippets on the linked page, but none of them appear to have the character "#". Could you show a minimal example of code that you know gives this error message? – trichoplax May 29 '16 at 14:26
• @trichoplax my bad. I should have explained that there is an executable provided in order for you to run it. I will update the question with a minimal example. – ealiaj May 29 '16 at 14:50

The error message gives a clue in the wording:

#version must occur before any other program statement


Is there a reason that the previous 2 lines need to appear before the #version line? If not, you can avoid the error by moving this line to the beginning, since the actions of the lines are independent of their order in this instance.

The #version needing to be at the beginning of the file is not a new requirement. I don't know why you were able to run this code previously.

• Yet as you can see by yourself Chapman's unedited algorithm is given in this exact form, and I do guarantee that it could run perfectly on this but also another computer (both having ATI graphics cards). I think it could have something to do with Vulkan and a more strict set of rules, but I have not been able to verify it yet. – ealiaj May 29 '16 at 20:56
• @green_leaf oh yes I'm not doubting that it did work - I just don't have an explanation for why. I guess the change was a "correction" even though it hasn't turned out to be helpful for you... – trichoplax May 29 '16 at 22:10
• that's very classic with ATI – v.oddou May 30 '16 at 1:04
• @v.oddou indeed now that you mention it. It seems that they do that quite often. – ealiaj May 30 '16 at 18:19