Author Topic: missing wx/setup.h  (Read 6985 times)

Offline bdad

  • Multiple posting newcomer
  • *
  • Posts: 29
missing wx/setup.h
« on: December 10, 2022, 10:43:54 pm »
codeblocks 20.3 has choices for versions of wxWidgets 2.6, 2.8, 3.0, 3.1  . I've recently installed version 3.2.1

I am getting an error when compiling - can't find wx\setup.h   I've found solutions for earlier versions of codeblocks/wx, but nothing more recent than about 2014, iirc, and they seem to not work.

Is there a detailed installation guide for installing wx, and simple beginner's setup/usage, I've not found anything recent? Am I right in thinking that I need to install a copy of wxWidgets that matches one listed in the codeblocks ide?

Quote
R:\wxWidgets-3.2.1\include\wx\platform.h|159|fatal error: wx/setup.h: No such file or directory|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 5 second(s)) ===|

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing wx/setup.h
« Reply #1 on: December 11, 2022, 12:35:30 am »
Am I right in thinking that I need to install a copy of wxWidgets that matches one listed in the codeblocks ide?

No, unless you wish to build Code::Blocks (CB) or CB Plugins the version does not need to match.

The wxWidgets library does almost always need to be built with the Compiler you are going to use.

Link to offsite directions https://forums.wxwidgets.org/viewtopic.php?f=19&t=47233

Tim S.
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 bdad

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: missing wx/setup.h
« Reply #2 on: December 11, 2022, 01:09:26 pm »
Thanks for the link. At first glance it looks a bit more complicated than 'install and run'. I'll see how it goes. At least it seems to be pretty much up to date.

Offline PB

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: missing wx/setup.h
« Reply #3 on: December 11, 2022, 03:39:30 pm »
Are you using the built-in wxWidgets project template wizard? The one shipped with C::B v20.03 does not support wxWidgets v3.2.

You need to use the wizard bundled with the C::B nightly build or the one I provide with my guide.

Anyway, adding wxWidgets to a project is really simple and no different from any other compiled library. The only difference is that one needs to add two include paths (build-specific and general), but this is well-documented.
« Last Edit: December 11, 2022, 03:53:49 pm by PB »

Offline bdad

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: missing wx/setup.h
« Reply #4 on: December 12, 2022, 03:44:35 pm »
Are you using the built-in wxWidgets project template wizard? The one shipped with C::B v20.03 does not support wxWidgets v3.2.

You need to use the wizard bundled with the C::B nightly build or the one I provide with my guide.

Anyway, adding wxWidgets to a project is really simple and no different from any other compiled library. The only difference is that one needs to add two include paths (build-specific and general), but this is well-documented.

Are you suggesting that I am more likely to succeed if I get a recent nightly builds, of codeblocks, (any one, or the most recent?)  and there is an included  wizard that will install wxWidgetsi.  I read through parts of your guide, which appears to be comprehensive, but in all honesty, I've little idea on how to proceed, at the moment. There seems to be too many choices for me, in particular when I have little idea of exactly what I now have on my system. Am I right in thinking that none of this needs to be installed on drive C:, provided i put in the full path name when asked in the installation procedures?

Offline PB

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: missing wx/setup.h
« Reply #5 on: December 12, 2022, 04:24:48 pm »
Are you suggesting that I am more likely to succeed if I get a recent nightly builds, of codeblocks, (any one, or the most recent?)  and there is an included  wizard that will install wxWidgetsi. 

AFAIK, there is no C::B wizard that is going to install wxWidgets for you. The wizard I mentioned just creates a C::B project using wxWidgets, but a wxWidgets build must be available.

I've little idea on how to proceed, at the moment. There seems to be too many choices for me, in particular when I have little idea of exactly what I now have on my system.
Building wxWidgets is no rocket science, all you need is:
1. Decide on which compiler to use and ensure it is installed and set-up in C::B.
2. Decide which wxWidgets version to use - I agree with your choice of v3.2.1.
3. Build wxWidgets in your desired configuration (e.g., shared vs static, 32- or 64-bit).
4. Create a C::B project using wxWidgets, either with the wizard from the nightly or my guide.

Am I right in thinking that none of this needs to be installed on drive C:, provided i put in the full path name when asked in the installation procedures?

wxWidgets certainly can be anywhere, I am not sure about the compiler. I am also not sure what you mean by the installation procedure. I would just download wxWidgets source archive and build it as described in the official docs or in my guide. Unless you have a very slow compiler, the build should take minutes or tens of minutes at most.

Offline bdad

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: missing wx/setup.h
« Reply #6 on: December 12, 2022, 05:51:00 pm »
Thanks, it's getting a bit clearer, I'll let you know how I get on.
I expect it will be the gnu gcc compiler, version 3.21 of wxWidgets and static 64 build. It seems that wxSmith is fairly straightforward. The only bit I think I've not done before, afaik,  is build wxWidgets.. I'l'l remove the existing and do a fresh install of it all.

Offline bdad

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: missing wx/setup.h
« Reply #7 on: December 12, 2022, 08:39:02 pm »
Hi ,
Going through your comprehensive PB guide, I'm stuck. It seems that the page you linked to Para 3.2, , my w10 complains about the fileo says it's unconfirmed, but I tried another page, and got msys2 installed, it needed no updates. The links to mingw toolchain, no longer seems to exist in para 3.3 . Of course, it could be me, I tried msys2 a week or two back, got nowhere with it. I guess your para 3.4 will be the way to go.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing wx/setup.h
« Reply #8 on: December 12, 2022, 09:46:19 pm »
I have never installed msys2 and it needed no updates; you are either lucky or wrong.

Command to update msys2 below
Code
pacman -Syuu

Tim S.
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 bdad

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: missing wx/setup.h
« Reply #9 on: December 12, 2022, 09:57:36 pm »
At least, afasi can tell, I've got wxwin environment variable set up, but then got stuck in trying to do a staticbuild of wx widgets, using your build-library-static.bat. So, as I think you mentioned to use a nightly build of codeblocks,, I thought I 'd try that but it says on that page

Quote
Before you use a nightly make sure you understand how it works.

A link to the unicode windows wxWidget dll(s) for Code::Blocks : https://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/Prerequisites/wxmsw32u_gcc_cb_wx321_2D_gcc810-mingw64.7z
A link to Mingw64 dll's needed by Code::Blocks : http://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/Prerequisites/Mingw64dlls8.1.0.7z


The 10 December 2022 build is out.
  - Windows :
   http://sourceforge.net/projects/codeblocks/files/Binaries/Nightlies/2022/CB_20221210_rev13107_win64.7z
  I have no idea on how to install that, so is there an 'idiot's guide' somewhere?
If I install the 20.03 release, that has a setup, is that the way, then install the nightly?

Offline PB

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: missing wx/setup.h
« Reply #10 on: December 12, 2022, 10:02:55 pm »
Hi ,
Going through your comprehensive PB guide, I'm stuck. It seems that the page you linked to Para 3.2, , my w10 complains about the fileo says it's unconfirmed, but I tried another page, and got msys2 installed, it needed no updates.

You should have downloaded and run file msys2-x86_64-20221028.exe. Did you?

The links to mingw toolchain, no longer seems to exist in para 3.3 . Of course, it could be me, I tried msys2 a week or two back, got nowhere with it. I guess your para 3.4 will be the way to go.

There are only two links in Chapter 3.3: https://packages.msys2.org/group/mingw-w64-x86_64-toolchain and https://www.msys2.org/docs/environments/#msvcrt-vs-ucrt and they are both working.

More importantly, they are not really needed for installing the compiler or installing wxWidgets, they only provide an optional information.

If you do not install the compiler package properly, you will not be able to continue with building wxWidgets or your application. This means you should start MSYS2 environment, run
Code
pacman -S mingw-w64-x86_64-toolchain
and press Enter when asked about installation.

But as I write in the guide, using MSYS2 is not mandatory, any compatible recent(-ish) mingw-64-based GCC distribution should work.

Offline PB

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: missing wx/setup.h
« Reply #11 on: December 12, 2022, 10:05:15 pm »
At least, afasi can tell, I've got wxwin environment variable set up, but then got stuck in trying to do a staticbuild of wx widgets, using your build-library-static.bat. So, as I think you mentioned to use a nightly build of codeblocks,, I thought I 'd try that but it says on that page
ll the 20.03 release, that has a setup, is that the way, then install the nightly?

Code::Blocks version and building wxWidgets are utterly unrelated, i.e., C::B version cannot in any way affect wxWidgets build. If you have a build error, you need to take a look at the error message.

You can also just use C::B v20.03 with my updated wizard from the guide GitHub repo, it even has a nice batch file to install it for the current C::B version.

But you seem to have an unusually high number of issues with such a simple task as building wxWidgets on Windows. All you need for it is to have a working compiler, extracted wxWidgets archive, and WXWIN set?
« Last Edit: December 12, 2022, 10:07:53 pm by PB »

Offline bdad

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: missing wx/setup.h
« Reply #12 on: December 13, 2022, 01:15:33 pm »
Hope I'm not trying your patience too much, I appreciate your help. I think I had internet problems yesterday, Today I had a raft of emails from my bank, going back to 17th Nov, and a registration code for git hub, that expired yesterday.

Anyway, I've reinstalled msys2, (and updated it) and have managed everything up to and including fig 3.1. 

I've now confused myself with choices and decisions. The basic requirement is that I want to use codeblocks and a gui design method of generating windows forms, etc., for which I need wxwidgets

I've got to where I've installed the mingw packages, at para 3.3 . Has that built wx widgets, or do I then carry on through to para 3.6.8 and then install codeblocks etc, and do all of section 4, or once wx widgets is built in section 3, I can use that build by just installing code blocks?  I need baby steps, but in the right order.

Offline PB

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: missing wx/setup.h
« Reply #13 on: December 13, 2022, 02:19:48 pm »
First, you do not need wxWidgets to create a GUI application for Windows, there are several other choices even for just C++.

Secondly, I hope that by "windows forms" you do not mean Microsoft's Windows Forms, which are available only for .NET.

Thirdly, if you are not sure how to proceed: Why not just follow the guide, including the order in which the individual steps are done? The guide is intended to be followed step by step (with the purpose of each step explained) and if you miss a step, you will not be able to finish it.

Lastly, for building wxWidgets, I would use a parallel build (e.g., with build-library-static-parallel.bat): If you have a computer suited for C++ development, it should speed-up the build considerably. You can tune the number of processors (the number after -j) for your computer, e.g., change the default -j4 to -j2 if your computer has only four cores, so you can still use the computer during the build. But this is also mentioned in the guide...

Offline bdad

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: missing wx/setup.h
« Reply #14 on: December 13, 2022, 04:49:38 pm »
Not microsoft windows forms, but those as mentioned under wxSmith. For me, your guide goes into too much detail, It takes me a while to even understand the terminology, and if I do, then next week it will be forgotten. Not your problem, of course, but I'm more familiar with simpler installation procedures. Anyway, we live and learn.