Page 1 of 1
Project can't find wx.rc
Posted: Tue Oct 18, 2022 12:20 am
by zebra224
Just trying to create a "hello world" app with wxWidgets. I have one lonely compiler error that will not go away:
Code: Select all
C:/Users/zebra/Documents/_Core_/Programming/Wxtest/win_resources.rc:1:10: fatal error: wx/msw/wx.rc: No such file or directory
1 | #include "wx/msw/wx.rc"
| ^~~~~~~~~~~~~~
compilation terminated.
I have "C:/wxWidgets/include/" in my include paths. I'm assuming that's correct because I was getting lots of other wx include errors until I added that path. I have visually verified wx/msw/wx.rc exists (screen shot attached), so I can't imagine what is wrong. Please help.
file_exists.JPG
Re: Project can't find wx.rc
Posted: Tue Oct 18, 2022 3:02 am
by zebra224
OK, after a few more hours of messing around, I've got a hack solution. Clearly I'm still missing something, and the available documentation both for CodeLite and wxWidgets is not nearly complete enough to explain the problem. Here's what I've found:
Resources are apparently build via different means, and there is a separate project setting for "additional search path" for resource files. Setting that resolved the "file not found" error but opened up a whole host of new errors.
The first new error is "wx/msw/amd64.manifest" not found. After hopelessly digging around for any hint of how these manifest files are generated, I finally figured out I could just bypass them by modifying win_resources.rc (project file) to:
Code: Select all
#define wxUSE_NO_MANIFST 1
#include "wx/msw/wx.rc"
After that modification, the build complains it can't find a whole bunch of library files:
Code: Select all
C:\w64devkit\bin/ld.exe: cannot find -lwxmsw32u_xrc: No such file or directory
C:\w64devkit\bin/ld.exe: cannot find -lwxmsw32u_webview: No such file or directory
C:\w64devkit\bin/ld.exe: cannot find -lwxmsw32u_html: No such file or directory
C:\w64devkit\bin/ld.exe: cannot find -lwxmsw32u_qa: No such file or directory
C:\w64devkit\bin/ld.exe: cannot find -lwxmsw32u_adv: No such file or directory
C:\w64devkit\bin/ld.exe: cannot find -lwxmsw32u_core: No such file or directory
C:\w64devkit\bin/ld.exe: cannot find -lwxbase32u_xml: No such file or directory
C:\w64devkit\bin/ld.exe: cannot find -lwxbase32u_net: No such file or directory
C:\w64devkit\bin/ld.exe: cannot find -lwxbase32u: No such file or directory
After digging around, I found out all my library file names end in "...32ud". Presumably the "d" is for debug. Why does the build chain want release versions? I don't know. Every path and setting I can find in CodeLite are all pointing at debug targets.
I tricked the build by renaming all my library files to end in "...32u". OMG, it builds without errors. But as soon as I run the program, it just exits.
On a whim, I went to the project output folder (bin) and tried running the executable directly. I got more useful information...it wants all the libraries to have the name ending in "...32ud". Not to mention, NONE of said library files are actually present in the project output (bin) folder. I manually copied over the wxWidget DLLs, ran the executable again, and it WORKS! I see a basic Windows application! Amazing!
It still leaves me with 2 questions: (1.) Why does running the program through CodeLite want non-debug DLLs for wxWidgets when the executable itself clearly wants the debug versions? (2.) As it has taken me over 12 hours to reach this point, HAS ANYONE AT CODELITE EVER ACTUALLY TESTED THINGS IN A WINDOWS ENVIRONMENT??? Missing files, conflicting expectations of file versions, jumping through endless hoops... It should NOT be this difficult.
Re: Project can't find wx.rc
Posted: Fri Oct 21, 2022 9:51 am
by eranif
CodeLite uses wx-config
for building the include path / library list for wxWidgets applications.
I just merged a PR that fixes the d
issue you mentioned:
https://github.com/eranif/wx-config-msy ... 6341b9dbb5
Regarding your question for testing CodeLite on Windows:
I am building CodeLite on Windows using wxWidgets and have created many applications on Windows, its my primary environment, so I say I did test a thing or two on Windows
Also, most of your questions are not really related to CodeLite. It will do whatever you want it to do. Building a wxWidgets application is not really a CodeLite domain, but more of wxWidgets one
If you will set the correct flags, include path + libraries -> it will work, but you need to know how to use the library (in your case: wxWidgets) in order to be able to use it