Author Topic: Trying to get wxWidgets 3.2 to work with CB...  (Read 5184 times)

Offline Sephiroth

  • Multiple posting newcomer
  • *
  • Posts: 17
Trying to get wxWidgets 3.2 to work with CB...
« 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 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?

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2790
Re: Trying to get wxWidgets 3.2 to work with CB...
« Reply #1 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 .
« Last Edit: October 08, 2023, 06:51:47 am by Pecan »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7627
    • My Best Post
Re: Trying to get wxWidgets 3.2 to work with CB...
« Reply #2 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.
« Last Edit: October 09, 2023, 01:21:24 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Sephiroth

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Trying to get wxWidgets 3.2 to work with CB...
« Reply #3 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.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1604
Re: Trying to get wxWidgets 3.2 to work with CB...
« Reply #4 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.

Offline wtfisgoingoff

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Trying to get wxWidgets 3.2 to work with CB...
« Reply #5 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
This repositoriy also has a new CodeBlocks wizard for wxWidgets project.

Offline Sephiroth

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Trying to get wxWidgets 3.2 to work with CB...
« Reply #6 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.

Offline Sephiroth

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Trying to get wxWidgets 3.2 to work with CB...
« Reply #7 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!