`ptr GlChar` should be compatible with `cstring`. Therefore I would suggest that this should work: let vertexShaderSrc = """ #version 400 in vec3 pos; void main() { gl_Position = vec4(pos, 1.0); } """ GLuint vertShader = glCreateShader(GL_VERTEX_SHADER) var charPtr : ptr GlChar = (ptr GlChar)(cstring(vertexShaderSrc)) glShaderSource(vertShader, 1, charPtr.addr, nil)
if it still doesn't work, use force: `var charPtr : ptr GlChar = cast[ptr GlChar](cstring(vertexShaderSrc))`