The code compiles without any errors. At runtime the code results in a segmentation fault. Using gdb I managed to find out that the line the application crashes on it the call to gtk_dialog_run. Does anyone know why this could be happening?
#include "config.h" //Configured constants
#include "platform.h" //Platform specific functions
int main(int argc, char* argv)
Platform::Initialize(argc, argv); //Initialize platform
glfwInit(); //Initialize GLFW
GLFWwindow* window = glfwCreateWindow(Config::WINDOWWIDTH,
Config::WINDOWHEIGHT, "Main window", nullptr, nullptr); //Create GLFW window
if(window == nullptr)
Platform::ShowMessage("Failed to create the main window"); //Show message on failure
Could it have something to do with the fact that I initialize GLFW after I initialize GTK? Maybe it uses GTK internally and it could be initialized twice?
It appears the call to glfwInit was the problem. Calling glfwInit after calling gtk_init seems to cause some parts of GTK3 to cause segmentation faults. The problem was solves by calling glfwInit before Platform::Initialize.
Thank you for your help. I thought GTK code was the problem.