It compiles without errors but it doesn't have any effect. I tried your way, there was no effect from the shader but the debugger did show correct output from shaderSource. I also tried to use it this way
bool CShader::loadVertexShader(int a_iType)
const GLchar* shaderSource = "#version 330\n"
"layout (location = 0) in vec3 inPosition;\n"
"layout (location = 1) in vec3 inColor;\n"
"smooth out vec3 theColor;\n"
"gl_Position = vec4(inPosition, 1.0);\n"
"theColor = inColor;\n"
uiShader = glCreateShader(a_iType);
glShaderSource(uiShader, 1, &shaderSource, NULL);
outfile.open ("log.txt", fstream::out | fstream::app);
outfile << shaderSource << endl;
outfile << endl;
glGetShaderiv(uiShader, GL_COMPILE_STATUS, &compileStatus);
if (compileStatus == GL_FALSE)
glGetShaderiv(uiShader, GL_INFO_LOG_LENGTH, &infoLogLength);
GLchar* infoLog = new GLchar[infoLogLength + 1];
glGetShaderInfoLog(uiShader, infoLogLength, NULL, infoLog);
outfile << infoLog << endl;
also no effect. I did this just in case I don't miss anything when doing this part
// Load shaders and create shader program