Assertion failed: title != NULL in window.c error which calls abort() after debbuging

Well i got stumped for two days looking for solution of this problem and i don’t know what should i do i tried multiple fixes with no results.Maybe there is a problem with my code which i can’t see.

Error feedback is in our native language:Lithuanian.
Glfw3 was built in cmake for 64bit windows application and code is debugged in 64bit.
For now application has to show red screen.
Coding architecture is inspired by Cherno’s sparky engine.
Main problem occurs after debbuging which in my case says Assertion failed: title != NULL, file c:\users\stabberknight906\documents\opengl\src\glfw-3.2.1\src\window.c, line 130. Which follows with Microsoft’s Visual c++ Runtime Library error: Debug Error! Program FRTI engine.exe. abort() has been called.

Please use proper code formatting for easier reading (put three ` symbols before and after code).

The error is in your Window constructor - you are not initializing corwidth/corheight/cortitle members of object. Instead you are overwriting widht/height/title arguments with uninitialized values from this object. cortitle happens to be NULL, that’s why you are hitting the assert when passing it to glfwCreateWindow function.

In this kind of situation you should really use a debugger. Run program in a debugger, and when code will assert the debugger will stop. And you will be able to examine call stack. In your case you would see that the function Window::init called glfwCreateWindow which asserted. Then you would be able to examine variable values - like corwidth, cortitle - then you would immediately see where is the error.

1 Like

Thank you very much i found the culprit of this error, instead of

width = corwidth;
height = corheight;
title = cortitle;

it should have been

corwidth = width;
corheight = height;
cortitle = title;