I am aware that the gl_ prefix are deprecated functions but this is just a default shader so I know everything works. This sample works fine under windows with my shader class.

Now onto my shader class, when I create a Shader object I call the load method which takes a path without a file extension. For example: ./data/shaders/default The loader takes this and searches for that string + .vert .geom or .frag for the appropriate shader programs. These are then loaded and passed to the OpenGL part of creating the programs. This is where something seems to go wrong, I can confirm that the content of the shader programs is correctly loaded from disk so this is not where the problem lies as far as I can see.

When the file is loaded it goes onto compiling the vertex and fragment programs (or geometry but this is optional):

a_Type is either GL_FRAGMENT_SHADER or GL_VERTEX_SHADER. a_Source is the content of the shader program file (the .vert/.frag/.geom file). When I load the vertex program the compilation instantly fails and if( success != GL_TRUE ) is hit and evaluated as being so and I get a compilation error. I don get any output whatsoever, the "Shader compile output" printf doesn't print any info about compilation. (The OGLCHECK is a macro which checks the opengl error stack, this doesn't show anything either.)

I'm unsure whats going on, this implementation works fine under windows as this is part of my rendering engine which I've ported to linux. Anyone had similar problems regarding shader compilation under linux?

I also grep'd on fragment_program, vertex_program, geometry_program and all these extension seem to be available. I'm running Ubuntu 12.04.

Update:
It seems its unrelated to the shaders files but something else, when I run it from a terminal its fine it compiles the shaders and uses them but whenever I run it from Code::Blocks it just fails to compile the shaders.. they are being loaded and passed to OpenGL. No clue whats going on.

Maybe DOS newline vs. Unix newline? DOS encodes newlines as a \r\n pair, wheras Unix encodes just n. By specification both are whitespace and the compiler should accept it, but maybe it chews up on that.
–
datenwolfJul 24 '12 at 13:51

Are you using the GL3.1+ Core Profile or just the compatibility profile on Windows and 3.1+ on linux ? If so, the shaders are non-standard on linux - you have to declare the out_FragColor elements manually
–
Viktor LatypovJul 24 '12 at 14:00

@datenwolf Checked, same result but thanks for the tip.
–
YonathanJul 24 '12 at 15:33

@ViktorLatypov I haven't thought about what to aim at. I declared my own out vec4 but still fails to compile. Could you show an example of both Core profile and compatibility profile for my shader ? This way I can see if this is the case or something else is going on.
–
YonathanJul 24 '12 at 15:35

Added an update, its not due to the shaders itself.
–
YonathanJul 25 '12 at 8:21