Page 1 of 1

msw/wx.rc not found, despite being in the include path

Posted: Thu Oct 05, 2023 7:47 pm
by amwink

Hi - I have installed all this in Windows:

  • C:\usr\local\gcc-13.2.0 (from winlibs)

  • C:\usr\local\cmake-3.27.6 (from KitWare)

  • C:\usr\local\wxWidgets-3.2.2.1 (from wxwidgets.org)

  • C:\usr\local\codelite-17.6.0 (from codelite.org)

Then I build wxWidgets in the directory C:\usr\local\wxWidgets-3.2.2.1\build (that seemed the right place to do that), using the CMake and gcc executables above, using mingw32-make from the compiler directory. The binaries end up in build\lib\gcc_x64_dll in the wxWidgets directory.

My plan is to just build a 'Hello World' program with a GUI, just to see how to do that with wxWidgets.

What I did to set up CodeLite were the following steps:

  1. changed Settings -> Build Settings, to add the compiler above

  2. changed Settings -> GDB Settings, to add the debugger in the same directory as the compiler

  3. added WXWIN=C:\usr\local\wxWidgets-3.2.2\build and WXCFG=gcc_x64_dll\mswu to the environment variables

Then, for the project:

  1. I started a new C++ workspace,

  2. opened a new project 'hello_wxwidget' of the category 'GUI', type 'wxWidgets GUI application', compiler and debugger as just specified, build system 'CodeLite Makefile Generator',

  3. in the Golbal Settings of the project itself, add 'C:\usr\local\wxWidgets-3.2.2.1\include' to the Additional Include Paths

The last item on the list was to get rid of the error wx/wxprec.h: No such file or directory. After adding the include directory, the C++ compiler itself returns no errors any more, but windres.exe returns the error wx/msw/wx.rc: No such file or directory.

But that does not make sense because this path is also in the same include directory that I have just added...

So I would be grateful to find out: does this mean I have done something wrong in my settings, in either the numbered or the lettered list? Should I not have built the wxWidgets library in the directory that was already there? Did I choose the wrong project type for this goal? Or is something else wrong that I haven't thought of?

Thanks for your help! Also: happy to send more information or output files if that makes the situation clearer.


Re: msw/wx.rc not found, despite being in the include path

Posted: Wed Oct 11, 2023 1:45 pm
by amwink

The file that produces the error is hello_wxwidget\win_resources.rc (that's the name of my project).

The lines that produce the error are these:

// this is not always needed but doesn't hurt (except making the executable
// very slightly larger): this file contains the standard icons, cursors, ...
#if !defined(__llvm__)
#include "wx/msw/wx.rc"
#endif

So what i have tried, if the lines are not always needed, is to comment them out.
Unfortunately I apparently do need them (for not using clang I guess) as with the lines commented out I get:

C:/usr/local/gcc-13.2.0/bin/windres.exe
-i "C:/Users/myname/Documents/cpp-devel/hello_wxwidget/win_resources.c"
--include-dir "C:/usr/local/wxwidgets-3.2.2.1/build/lib/gcc_x64_dll/mswu"
--include-dir "C:/usr/local/wxwidgets-3.2.2.1/build/include"
--define __WXMSW__ --define __UNICODE__ --define __WXUSINGDLL__
-o ../build-Debug/hello-wxwidget/win_resources.rc.0
C:/usr/local/gcc-13.2.0/bin/windres.exe: no resources

This is strange because in my project settings (Global Settings) I include C:/usr/local/wxwidgets-3.2.2.1/include, which has a path wx/msw/wx.rc in its tree, but the windres.exe command line includes ``, which does not exist.

After I copy the directory C:/usr/local/wxwidgets-3.2.2.1/include also to C:/usr/local/wxwidgets-3.2.2.1/build I can succesfully compile the program, but nothing (no window / GUI) appears on the screen when I run it, except:

Executing: hello_wxwidget.exe
Program exited

Does this mean that the installation of wxWidgets has not finished correctly, or is there something wrong in my setup of CodeLite?


Re: msw/wx.rc not found, despite being in the include path

Posted: Tue Nov 07, 2023 11:45 pm
by eranif

You should take this to the wx forum...