windres.exe -IC:\wxWidgets-3.2.1\lib\gcc_lib\mswud -I"C:\Program Files\PostgreSQL\15\include" -IC:\wxWidgets-3.2.1\include -J rc -O coff -i C:\Users\jurha\DOCUME~1\CODEBL~1\TBGUI\resource.rc -o obj\Debug\resource.res
gcc: error: Files\PostgreSQL\15\include: No such file or directory
windres.exe: preprocessing failed.
Process terminated with status 1 (0 minute(s), 21 second(s))
Process terminated with status 0 (0 minute(s), 22 second(s))
2 error(s), 8 warning(s) (0 minute(s), 22 second(s))
I think it is pretty clear why this fails. It fails because windres has an invalid include path (i.e.,
Files\PostgreSQL\15\include). It seems that your version of windres still cannot deal with paths with spaces even when they are in quotes. You can see that C::B converts the long name for the .rc file to the short one but the include paths are not.
Of course, when you have no .rc file in the project, windres (GCC's resource compiler) is not invoked so the build succeeds.
BTW, I think you can avoid all the warnings too. Using a non-deprecated wxFont ctor is a no brainer and the rest should be avoided by doing proper casts or conversions.
EDITI just tried to build a wizard-generated project where I added in project build options to Search Directories / Resource Compiler path
C:\dev\Folder with Spaces\includewindres.exe -ID:\Dev\Desktop\!Lib\wxWidgets-3.2.1\include -ID:\Dev\Desktop\!Lib\wxWidgets-3.2.1\lib\gcc_dll-x64\mswud -I"C:\dev\Folder with Spaces\include" -J rc -O coff -i C:\dev\cb-tests\Test321b\resource.rc -o obj\Debug\resource.res
g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -ID:\Dev\Desktop\!Lib\wxWidgets-3.2.1\include -ID:\Dev\Desktop\!Lib\wxWidgets-3.2.1\lib\gcc_dll-x64\mswud -c C:\dev\cb-tests\Test321b\Test321bApp.cpp -o obj\Debug\Test321bApp.o
g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -ID:\Dev\Desktop\!Lib\wxWidgets-3.2.1\include -ID:\Dev\Desktop\!Lib\wxWidgets-3.2.1\lib\gcc_dll-x64\mswud -c C:\dev\cb-tests\Test321b\Test321bMain.cpp -o obj\Debug\Test321bMain.o
g++.exe -LD:\Dev\Desktop\!Lib\wxWidgets-3.2.1\lib\gcc_dll-x64 -o bin\Debug\Test321b.exe obj\Debug\Test321bApp.o obj\Debug\Test321bMain.o obj\Debug\resource.res -mthreads -lwxmsw32ud_core -lwxbase32ud -mwindows
Output file is bin\Debug\Test321b.exe with size 908.50 KB
and windres did not complain at all. However, I use the up-to-date MSYS2 mingw-w64-x86_64-toolchain package (windres v2.39).