Re: Error with Glew

2018-11-15 Thread treeform
Yeah that is the right idea. I think you did it very complicated. I would just put: {.emit:""" #include "GL/glew.h" #include "GLFW/glfw3.h" //glfw3 must be the last include """.} Run At the top of your main file.

Re: Error with Glew

2018-11-14 Thread DTxplorer
Thanks for the answer. I found a workaround by creating this c file who does the includes. #ifndef C_INCLUDES # define C_INCLUDES # include "GL/glew.h" # include "GLFW/glfw3.h" //glfw3 must be the last include #endif Run I added this

Re: Error with Glew

2018-11-13 Thread treeform
I bet glfw3.h includes gl.h before you include glew.h. You could move the "glewInit" function first. Or create hacky {.emit.} and order the imports manually. This is all C crazyness nim is trying to get a way from.

Error with Glew

2018-11-13 Thread DTxplorer
Sorry for the boring topic. I'm writing a side project for fun using Glew and Glfw. And I encounter an external compiler error. A test file who reproduces the error. const GLFW_CONTEXT_VERSION_MAJOR = 0x00022002 GLFW_CONTEXT_VERSION_MINOR = 0x00022003