0

Opening a new questions as some older answer does not 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).

The error message is at line

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:

--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:

--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?
Federico Perini
  • 1,414
  • 8
  • 13

1 Answers1

1

This is really strange because the use of --use-temp-file was removed from wx makefiles in the commit 093c3067e8 (Don't use windres --use-temp-file option, 2020-07-13) which is part of 3.1.4, so you shouldn't be seeing it at all.

But wait, it's even stranger, because wx-config doesn't have --rcflags option that you apparently use. It does have --rescomp option, but it has never included --use-temp-file in its output at all, AFAICS, and definitely not in 3.1.4.

So it looks like you're using something other than the official 3.1.4 version. And the answer to your first question is to use the official sources instead.

VZ.
  • 21,740
  • 3
  • 39
  • 42
  • Got it, thanks for your answer! Here's what I found. 1) CodeLite is shipped with a pre-compiled Windows version of wx-config.exe, which is being picked as there's no others in the `PATH`, so perhaps it's based on an older source code that didn't have that fix? 2) You're right, I can run `bash wx-config.in --rescomp`, but it won't find the library's environment variables most likely because it's being run on Windows with mingW64 – Federico Perini Feb 15 '21 at 14:58
  • I'm guessing the Windows version comes from https://wiki.wxwidgets.org/Wx-config_Windows_port this port, whose source code unfortunately points to a broken link – Federico Perini Feb 15 '21 at 15:06
  • Yes, I know that there is a number of wx-config equivalents for Windows, but unfortunately they're not under our control and I have no idea what to do about them. `wx-config.in` can't be used directly, you need to run configure to generate the real `wx-config` first. – VZ. Feb 15 '21 at 17:26