OpenGL shader error with wxwidgets : I'm writing an openGL program using the wxWidgets library, I have it mostly working, but I am getting shader compilation errors due to bad characters being inserted (I think), only I can't find where the characters are or what is causing them. The error is :

    error 0(1) : error C0000: syntax error, unexpected $undefined at token "<undefined>"

 I'm not sure why though, since I can't see any errors when I cout the string. Here is what is being fed to glshadersource() :

    #version 430 core

    layout(location =0) in vec3 vpos;

    //out vec3 fragmentColor;
    uniform mat4 MVP;

    void main(void)

    {
        gl_Position = MVP * vec4(vpos,1);
    };"

Here are the shader compiler functions I use:

    void GL_set::compileAndLink()
    {

	    GLint Result = GL_FALSE;
 	    int InfoLogLength = 0;

	    // Create vertex shader, attach source code, compile
	    vertexShader = glCreateShader(GL_VERTEX_SHADER);
	    const GLchar* adapter[1];
	    adapter[0] = readShaderCode("Vshader.glsl").c_str();
	    glShaderSource(vertexShader, 1, adapter, NULL);
	    glCompileShader(vertexShader);

	    // Check vertex shader for errors
	    glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &Result);
 	    glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &InfoLogLength);
 	    if (InfoLogLength > 0)
	    {
		    char vertexError[1000];
 		    glGetShaderInfoLog(vertexShader, InfoLogLength, NULL, &vertexError[0]);
 		    std::cout << &vertexError[0];
 	    }

	    // Create fragment shader, attach source code, compile
	    fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
	    adapter[0] = readShaderCode("Fshader.glsl").c_str();
	    glShaderSource(fragmentShader, 1, adapter, NULL);
	    glCompileShader(fragmentShader);

	    // Check fragment shader for errors
	    glGetShaderiv(fragmentShader, GL_COMPILE_STATUS, &Result);
 	    glGetShaderiv(fragmentShader, GL_INFO_LOG_LENGTH, &InfoLogLength);
 	    if (InfoLogLength > 0)
	    {
		    char fragmentError[1000];
 		    glGetShaderInfoLog(fragmentShader, InfoLogLength, NULL, 
            &fragmentError[0]);
 		    std::cout << &fragmentError[0];
 	    }

	    // Create program and attach shaders
	    program = glCreateProgram();
	    glAttachShader(program, vertexShader);
	    glAttachShader(program, fragmentShader);
	    glLinkProgram(program);

	    //check program for errors
	    glGetProgramiv(program, GL_LINK_STATUS, &Result);
 	    glGetProgramiv(program, GL_INFO_LOG_LENGTH, &InfoLogLength);
	    if (InfoLogLength > 0)
	    {
	 	    char programError[1000];
		    glGetProgramInfoLog(program, InfoLogLength, NULL, &programError[0]);
		    std::cout << &programError[0];
	    }

    }



    std::string GL_set::readShaderCode(const char* fileName)
    {
        printf("passing %s to readShaderCode() \n", fileName);
	    std::ifstream input(fileName);
	    if(!input.good())
	    {
		    std::cout << "failed to load file " << fileName;
		    exit(1);
	    }

	    std::string code = std::string(
	    std::istreambuf_iterator<char>(input),
	    std::istreambuf_iterator<char>()
	    );

        // output the code to cout for error checking
        std::cout << "Read shader input: \n" << code << "\n" << std::endl;


	    return code;
    }


Here is the full console output:

    normal display attribs are supported
    calling gl_init()
    gl_set construtor called
    setting buffers
    passing Vshader.glsl to readShaderCode()
    Read shader input:
    #version 430 core

    layout(location =0) in vec3 vpos;

    //out vec3 fragmentColor;
    uniform mat4 MVP;

    void main(void)
    {
        //output position of the vertex in clip space MVP*position
        gl_Position = MVP * vec4(vpos,1);
    };



    0(1) : error C0000: syntax error, unexpected $undefined at token "<undefined>"
    passing Fshader.glsl to readShaderCode()
    Read shader input:
    #version 430 core

    in vec3 fragmentColor;

    out vec3 color;

    void main()
    {
        color = fragmentColor;
    };



    0(1) : error C0000: syntax error, unexpected $undefined at token "<undefined>"
    Vertex info
    -----------
    0(1) : error C0000: syntax error, unexpected $undefined at token "
    <undefined>"
    (0) : error C2003: incompatible options for link

    Fragment info
    -------------
    0(1) : error C0000: syntax error, unexpected $undefined at token "<undefined>"
    (0) : error C2003: incompatible options for link
    Loading OBJ file mod.obj...



Here is the rest of the class:

    #include "GL_set.h"

    GL_set::GL_set()
    {

        std::cout << "gl_set construtor called" << std::endl;

        GL_set::setBuffers();

    }


    void GL_set::setBuffers()
    {

        std::cout << "setting buffers" << std::endl;

	    glGenVertexArrays(1, &vao);
	    glBindVertexArray(vao);

	    //create shaders and attach them to the program object
  	    GL_set::compileAndLink();

	    loadOBJ("mod.obj", vdata); // use OBJ loader

	    glGenBuffers(1, &vertexbuffer);
	    glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
	    glBufferData(GL_ARRAY_BUFFER, vdata.size()*sizeof(glm::vec3), &vdata[0], GL_STATIC_DRAW);

	    //vertex buffer
	    glEnableVertexAttribArray(0);
	    glBindBuffer(GL_ARRAY_BUFFER, vertexbuffer);
	    glVertexAttribPointer(
		    0,			//index
		    3,			//size
		    GL_FLOAT,	//type
		    GL_FALSE,	//normalized?
		    0,			//stride
		    0	        //array buffer offset
	    );

    }

    void GL_set::draw()
    {

        glBindVertexArray(vao);


        GLuint matrixID = glGetUniformLocation(program, "MVP");


        ////////////////////////////matrix operations/////////////////////////////////////////

        //projection matrix 45 degree FoV, 4:3 ratio, display range 0.1 - 100
        glm::mat4 projection = glm::perspective(45.0f, 4.0f/3.0f, 0.1f, 100.0f);

        //camera matrix
        glm::mat4 view = glm::lookAt(
                     glm::vec3(8, 8,  8), //camera posiiton
                     glm::vec3(0, 1,  0), //camera looks at this point
                     glm::vec3(0, 1,  0)  //head up position
                     );

        //model matrix identity matrix
        glm::mat4 model = glm::mat4(1.0f);

        //rotate
        model = glm::rotate(model, 1.0f, glm::vec3(1,1,1));

        //model-view-projection
        glm::mat4 MVP = projection * view * model;

    
  
        /////////////////////////////////////////////////////////

        glUniformMatrix4fv(matrixID, 1, GL_FALSE, &MVP[0][0]);


        glDrawArrays(GL_TRIANGLES, 0, vdata.size()*sizeof(glm::vec3));


    }




I think the wxWidgets related code I have is okay, the window interface loads with a blank white screen, presumably caused by the shader errors. I can post more if needed, thanks. 