Code::Blocks Forums

User forums => Help => Topic started by: Sephiroth on October 07, 2023, 09:33:37 pm

Title: Trying to get wxWidgets 3.2 to work with CB...
Post by: Sephiroth on October 07, 2023, 09:33:37 pm
I'm trying to build a cross-platform, GUI app and settled on wxWidgets for the task. The thing is, wxWidgets is at version 3.2 and CB (any release I can find) is over three years old, and only supports 3.1, which I select. I built wxWidgets following this guide (https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide) and I also setup a global variable (wx) pointing to the wxWidgets path as well ass lib and include. However, once I select my options when creating a project, it tells me that it cannot find release or debug builds. Not sure where to go from here. Am I missing a newer release of CB?
Title: Re: Trying to get wxWidgets 3.2 to work with CB...
Post by: Pecan on October 08, 2023, 06:50:00 am
You might want to consider using a nightly build.
https://forums.codeblocks.org/index.php/topic,25547.msg173876.html#msg173876

It contains all the binaries you'll need.

You'll need wxWidgets source if you plan to use wxWidgets to build you're app. To build the source of wxWidgets, use the version noted in the nightly download announcement.
To build the source I use a batch file:
Code
:DoClean
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb CXXFLAGS+="-std=c++11" clean
[code]
:DoCompilesOnly
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 VENDOR=cb CXXFLAGS+="-std=c++11"

You will also need the Mingw compiler. Look for the version that matches the downloaded binaries.

wxWidgets source is not needed if do  not plan to use it in your app .
Title: Re: Trying to get wxWidgets 3.2 to work with CB...
Post by: stahta01 on October 08, 2023, 10:29:19 pm
Unless you are building Code::Blocks (IDE or Plugins) it is best to use MONOLITHIC=0 and skip the "VENDOR=cb", also.

Tim S.
Title: Re: Trying to get wxWidgets 3.2 to work with CB...
Post by: Sephiroth on November 25, 2023, 08:19:07 am
Sorry, I have been unavailable for over a month. Life was keeping me from my hobby.

With that said, I unzipped wxWidgets 3.2.2.1 into "C:\Program Files\CodeBlocks\wxWidgets-3.2.2.1", setup the search paths in the compiler options "$(#wx.LIB)\gcc_lib\mswu" and "mswud", setup the global "wx" variable pointing to the correct places, and went in and built both debug and release builds of wxWidgets using a command-prompt as follows.
Code
cd "Program Files\CodeBlocks\wcWidgets-3.2.2.1\build\msw
mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=0 UNICODE=1 BUILD=debug
mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=0 UNICODE=1 BUILD=release
I then changed to the "samples/minimal" directory and built that project. It builds and runs flawlessly. However, I can never finish the wizard due to it erroring out at the end, telling me it can't find matching debug or release builds. I do intend on using wxWidgets in my project so I can build it under Linux as well.

I saw the suggestion to use a nightly CB build. It's been almost four years since the last release. Is there ever going to be another stable release or at least a patch release to bring 20.03 up to current-day library support for things like wxWidgets? I despise what MSVS has become (I am NOT creating a damn account just to use an IDE!) and CB has been my go-to since around 2010. I just wish it was up-top-date.
Title: Re: Trying to get wxWidgets 3.2 to work with CB...
Post by: Miguel Gimenez on November 25, 2023, 01:02:59 pm
The wizard looks if "$(#wx)/include/wx/wx.h" exists, check if your wx vaiable points to the correct folder (where include and lib reside).

BTW, you must add "$(#wx.INCLUDE)" to the compiler search path.
Title: Re: Trying to get wxWidgets 3.2 to work with CB...
Post by: wtfisgoingoff on November 25, 2023, 01:19:34 pm
you might want to read this guide for building wxWidgets and using it in CodeBlocks.
https://github.com/PBfordev/wxpbguide (https://github.com/PBfordev/wxpbguide)
This repositoriy also has a new CodeBlocks wizard for wxWidgets project.
Title: Re: Trying to get wxWidgets 3.2 to work with CB...
Post by: Sephiroth on November 25, 2023, 04:50:03 pm
The wizard looks if "$(#wx)/include/wx/wx.h" exists, check if your wx vaiable points to the correct folder (where include and lib reside).

BTW, you must add "$(#wx.INCLUDE)" to the compiler search path.
I did add that, but did not post about it. I have the include folder searchable also.
Title: Re: Trying to get wxWidgets 3.2 to work with CB...
Post by: Sephiroth on November 27, 2023, 12:31:52 am
I just wanted to report back that I am good. Updating the wizard from the repository that was linked above fixed everything. I can now create wxWidgets apps and use wxSmith without a hitch. Thank you!