How to debug in Codeblocks?

First set a breakpoint at the beginning of your code or codeblocks won’t go line by line. When you run your program with debug mode (check the menus) you should get some toolbars with controls to advance lines and view variables. You can you the value of a variable by hovering over it in your … Read more

Static-linking of SDL2 libraries

It’s not necessary to recompile the library, SDL2 is given with static-link library named “libSDL2.a” on the folder “SDL2-2.0.0\i686-w64-mingw32\lib\”. Just be sure to add these options to the linker : “-lmingw32 -lSDL2main -lSDL2 -mwindows -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -static-libgcc” on Code:Blocks at “Project / Build Options… … Read more

Warning: array subscript has type char

Simple, change char j; to unsigned char j; or to just a plain (u)int unsigned int j; int j; From GCC Warnings -Wchar-subscripts Warn if an array subscript has type char. This is a common cause of error, as programmers often forget that this type is signed on some machines. This warning is enabled by … Read more