Page 1 of 1

windres cannot find "wx/msw/wx.rc" building wxWidgets project with MSYS2-mingW64

Posted: Sun Feb 14, 2021 12:22 pm
by perini1
I've found a similar post on stackoverflow, but that does not seem to apply to my case.

As per subject, I cannot compile a basic wxWidgets "Hello, World" program in Windows 10 with CodeLite 14 and wxWidgets 3.1.4 (compiled using MSYS2-mingW64) with the default CodeLite settings.

The error message is at line

Code: Select all

C:/Users/Federico/codelite/wxHelloWorld/win_resources.rc:1:10: fatal error: wx/msw/wx.rc: No such file or directory
    1 | #include "wx/msw/wx.rc"
      |          ^~~~~~~~~~~~~~
compilation terminated.

The resource file flags returned by wx-config running `wx-config --rcflags` are:

Code: Select all

--use-temp-file --define __WXMSW__ --define _UNICODE --include-dir C:/wx/3.1.4-msys/lib/gcc_lib/mswu --include-dir C:/wx/3.1.4-msys/include
All folders/files are properly in place. By tinkering with these flags I found that no errors are given, and the program is properly compile, if I _remove_ the `--use-temp-file` flag, like:

Code: Select all

--define __WXMSW__ --define _UNICODE --include-dir C:/wx/3.1.4-msys/lib/gcc_lib/mswu --include-dir C:/wx/3.1.4-msys/include
Then everything works. Unfortunately, that flag is assumed by default by wx-config, so the only easy solution to not have it would be to just stop using 'wx-config' and manually configure all compiler flags. So:
  • Is there any ways I could avoid this?
  • What is that flag meant for?

Re: windres cannot find "wx/msw/wx.rc" building wxWidgets project with MSYS2-mingW64

Posted: Tue Feb 16, 2021 6:08 pm
by perini1
Please refer to the same question as posted on stackoverflow:

looks like wx-config.exe has not been updated to a recent wxWidgets fix where that flag was removed. Apparently it was only useful with very old Windows OSes.

I still don't know why that would cause the issue, but I'm leaving it here as a suggestion for a next CodeLite bugfix release

Re: windres cannot find "wx/msw/wx.rc" building wxWidgets project with MSYS2-mingW64

Posted: Sun Feb 21, 2021 1:46 am
by eranif
this flag was removed from our wx-config since this commit:

https://github.com/eranif/codelite/comm ... 7ad6637e2c