Author Topic: Upgrading to wxWidgets 3.1.3  (Read 1878 times)

Offline spflanze

  • Almost regular
  • **
  • Posts: 133
Upgrading to wxWidgets 3.1.3
« on: February 20, 2020, 04:35:14 am »
After doing all I know, and additional things I can find, to do this upgrade, when I attempt to compile I get this error:
Code: [Select]
-------------- Build: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------

[  7.1%] mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP -g -D__WXDEBUG__ -Winline -Wall -pg -m64 -g -g3 -IC:\wxWidgets-3.1.3\include -I..\Libraries\cminpack-1.3.6 -Iinclude\ -IC:\wxWidgets-3.1.2-posix\lib\gcc_dll\mswud -c "C:\Software\Designer\wx_pch.h" -o "wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch"
Execution of 'mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP -g -D__WXDEBUG__ -Winline -Wall -pg -m64 -g -g3 -IC:\wxWidgets-3.1.3\include -I..\Libraries\cminpack-1.3.6 -Iinclude\ -IC:\wxWidgets-3.1.2-posix\lib\gcc_dll\mswud -c "C:\Software\Designer\wx_pch.h" -o "wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch"' in 'C:\Software\Designer' failed

In this compile command I see "IC:\wxWidgets-3.1.2-posix\lib\gcc_dll\mswud". This is an out of date path. I have found where many of the paths are set, but not this one. Where is this one set?

This is a very terse error message that does not say what the error is. How can I get more verbose messages that do say what the error is?

Online stahta01

  • Lives here!
  • ****
  • Posts: 6899
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #1 on: February 20, 2020, 05:07:46 am »
Look at the CB Project setting; remember to check both the project and each target setting.

Edit: "Search Directories" -> "Compiler" and "Search Directories" -> "Resource Compiler"
And, as noted before check all the places in left hand pane (project/targets)

Edit2: If not found there, then check "Compiler Settings" -> "other compiler options" and
"Compiler Settings" -> "other resource compiler options"

Tim S.
« Last Edit: February 20, 2020, 05:18:19 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline spflanze

  • Almost regular
  • **
  • Posts: 133
Re: Upgrading to wxWidgets 3.1.3
« Reply #2 on: February 21, 2020, 02:00:47 am »
That is where 3.1.2 was. I missed that earlier. Thanks. Now I am seeking to use the wx variable to make future upgrades easier. In the path: "Settings => Global variables => wx" I have these settings:
Code: [Select]
base: C:\wxWidgets-3.1.3
include:
lib: \lib\gcc_lib
bin: \bin

For my project, for which I will name here "Designer", I right click Designer in the Projects tab of the Management pane, and navigate the path: Designer => Build Options => Debug => Search Directories (tab) -> Compiler (tab) I have:
Code: [Select]
$(#wx.lib)\gcc_dll\mswuWhen I attempt to compile my project in Code::Blocks I get the error:
Code: [Select]
[ 14.3%] mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP -g -D__WXDEBUG__ -Winline -Wall -pg -m64 -g -g3 -I..\Libraries\cminpack-1.3.6 -I\lib\gcc_lib\gcc_dll\mswu -c "C:\Software\Designer\wx_pch.h" -o "wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch"

Execution of 'mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP -g -D__WXDEBUG__ -Winline -Wall -pg -m64 -g -g3 -I..\Libraries\cminpack-1.3.6 -I\lib\gcc_lib\gcc_dll\mswu -c "C:\Software\Designer\wx_pch.h" -o "wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch"' in 'C:\Software\Designer' failed.
In this compile command I see the path: -I\lib\gcc_lib\gcc_dll\mswu
My expectation was that the text "$(#wx.lib)" would be replaced by "C:\wxWidgets-3.1.3\lib\gcc_lib . This has not happened. The base "C:\wxWidgets-3.1.3\" is missing. Have I misunderstood how this global variable works?

For use in debug mode is a separate debug compilation of wxWidgets 3.1.3 required?


« Last Edit: February 21, 2020, 02:05:14 am by spflanze »

Online stahta01

  • Lives here!
  • ****
  • Posts: 6899
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #3 on: February 21, 2020, 02:45:31 am »
Quote
base: C:\wxWidgets-3.1.3
lib: \lib\gcc_lib

I would go with the normal default for windows of empty string which results in C:\wxWidgets-3.1.3\lib
Or you could use
lib: C:\wxWidgets-3.1.3\lib\gcc_lib

Then
"$(#wx.lib)\gcc_dll\mswu"
would need to be
"$(#wx.lib)\gcc_lib\mswu" if using the normal default
or
"$(#wx.lib)\mswu" if using my next suggestion

Tim S.


« Last Edit: February 21, 2020, 02:59:01 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 6899
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #4 on: February 21, 2020, 02:51:48 am »
FYI:

Quote
bin: \bin
Is wrong, you will likely want it to be default of blank which results in a bin folder under the base path or
bin: C:\wxWidgets-3.1.3\lib
That would point you to the DLLs or static libraries

Tim S.


C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 6899
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #5 on: February 21, 2020, 02:57:49 am »
Quote
For use in debug mode is a separate debug compilation of wxWidgets 3.1.3 required?

No, but sometimes you might wish to make one with all the symbols.
The wxWidgets in 3.1 is normally build with debug symbols; but, it can be built with more or less debug information. wxWidgets 2.8 was normally built without debug information. Not sure about 3.0

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline spflanze

  • Almost regular
  • **
  • Posts: 133
Re: Upgrading to wxWidgets 3.1.3
« Reply #6 on: February 21, 2020, 04:50:35 am »
Thanks for your reply. I made all those global file fields blanks as you recommended. That path is now a valid one. I made a bad assumption when I thought the content of those fields would be appended to the base. I see now they are not, and are a complete replacement for what is default.

The project still does not compile. In the error message I see: -Winvalid-pch. I think this is a message from the make file that says something has gone wrong with precompiled headers. Your suggestions about troubleshooting this would be appreciated.

This is the command I used to compile wxWidgets.
Code: [Select]
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=releaseIt is copied from this web page: https://wiki.wxwidgets.org/Compiling_wxWidgets_with_MinGW
If I were to compile for those higher levels of debug ability, how would this be changed?

Online stahta01

  • Lives here!
  • ****
  • Posts: 6899
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #7 on: February 21, 2020, 05:30:28 am »
Post the current build log?
And, are you wanting to build an wxWidgets shared/DLL or a static library?

Because, what you have posted conflicts with each other.

Edit from build/msw/config.gcc
Code: [Select]
# Type of compiled binaries [debug,release]
BUILD ?= debug

# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= default

# Value of wxDEBUG_LEVEL. The default value is the same as 1 and means that all
# but expensive assert checks are enabled, use 0 to completely remove debugging
# code. [0,1,default]
DEBUG_FLAG ?= 1

Edit2: To have the most debug information I think you need to use "DEBUG_FLAG=2" when building wxWidgets.

Edit3: See wx/debug.h for more information

Tim S.
« Last Edit: February 21, 2020, 05:44:13 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline sodev

  • Regular
  • ***
  • Posts: 380
Re: Upgrading to wxWidgets 3.1.3
« Reply #8 on: February 21, 2020, 06:19:13 pm »
That is where 3.1.2 was. I missed that earlier. Thanks. Now I am seeking to use the wx variable to make future upgrades easier. In the path: "Settings => Global variables => wx" I have these settings:
Code: [Select]
base: C:\wxWidgets-3.1.3
include:
lib: \lib\gcc_lib
bin: \bin

These leading backslash in the lib and bin path might be interpreted as absolute path and this seems to result into this path beeing used as-is. Without the leading backslash for me these fragments get correctly appended to the base path. If the fields are empty they expand into their name. The CodeBlocks project files append the gcc_lib fragment themself (which is kind if annoying for me because my wxWidgets builds use tagged output folders for quite some time now.

Quote
-Winvalid-pch

This is not an error message but a compiler option to enable a warning about incompatible PCH settings, this won't create a compiler error.

Quote
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release

You are building on windows and AFAIK the CodeBlocks project files require a monolithic build, this might be the cause for your errors. Add a MONOLITHIC=1 and check if this resolves your errors.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6899
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #9 on: February 21, 2020, 06:46:14 pm »
You are building on windows and AFAIK the CodeBlocks project files require a monolithic build, this might be the cause for your errors. Add a MONOLITHIC=1 and check if this resolves your errors.

False, the CB projects to build CB require MONOLITHIC; but, there is no issues using an non MONOLITHIC project in CB.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline sodev

  • Regular
  • ***
  • Posts: 380
Re: Upgrading to wxWidgets 3.1.3
« Reply #10 on: February 21, 2020, 07:01:33 pm »
Oops, for some unknown reason i thought he is building CodeBlocks ::) ;D

Well, but because he is not, it is easier to use a debug build of wxWidgets.

Code: [Select]
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=debug
This produces a variant with debug symbols and also enables the assertions. No need to mess around with debug levels, the default settings are good enough. Create a second configuration and link against that debug variant.

About possible PCH related problems, depending on the PCH strategy CodeBlocks might not delete a present PCH file. Check the output folders and remove all PCH files to start a fresh build.

Offline spflanze

  • Almost regular
  • **
  • Posts: 133
Re: Upgrading to wxWidgets 3.1.3
« Reply #11 on: February 22, 2020, 12:22:30 am »
I recompiled wxWidgets. This is the batch file I did it with:

Code: [Select]
REM Change the current working directory
cd  C:\wxWidgets-3.1.3\build\msw

REM Compile the release version
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release clean
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release

REM Compile the debug version
mingw32-make -f makefile.gcc MONOLITHIC=1  SHARED=1 UNICODE=1 BUILD=debug clean
mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=debug

In Code::Blocks, when I attempt to compile in debug my application that did compile before the wxWidgets upgrade, I still get an error:
Code: [Select]

-------------- Build: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------

[  5.0%] mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP -g -D__WXDEBUG__ -Winline -Wall -pg -m64 -g -g3 -I..\Libraries\cminpack-1.3.6 -IC:\wxWidgets-3.1.3\lib\gcc_dll\mswud -c "C:\Software\Designer\wx_pch.h" -o "wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch"

Execution of 'mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -include wx_pch.h -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP -g -D__WXDEBUG__ -Winline -Wall -pg -m64 -g -g3 -I..\Libraries\cminpack-1.3.6 -IC:\wxWidgets-3.1.3\lib\gcc_dll\mswud -c "C:\Software\Designer\wx_pch.h" -o "wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch"' in 'C:\Software\Designer' failed.

Online stahta01

  • Lives here!
  • ****
  • Posts: 6899
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #12 on: February 22, 2020, 12:53:55 am »
Please post information about your Compiler?

Edit: You do know that wxWidgets is a C++ Library, therefore you should use the same compiler to built it and the code that uses the library.

And, to build a 64 bit application the compiler and the library both need to be 64 bit.

Tim S.
« Last Edit: February 22, 2020, 12:59:42 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Online stahta01

  • Lives here!
  • ****
  • Posts: 6899
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #13 on: February 22, 2020, 01:06:33 am »
NOTE: I would stop trying to build the pch file till you get the rest of the files to build.
The error message is not very good while building the PCH (Precompiled Header)

You can do this by disable compile on the file "wx_pch.h"
And, I would remove the option "-include wx_pch.h" till you start trying to build PCH again.
You also, should replace "-DWX_PRECOMP" with "-DNOPCH"

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline sodev

  • Regular
  • ***
  • Posts: 380
Re: Upgrading to wxWidgets 3.1.3
« Reply #14 on: February 22, 2020, 01:54:34 am »
Code: [Select]
[  5.0%] mingw32-g++.exe -Wall -pipe -mthreads...

This percentage display at the start of line looks unfamiliar for me, usually the CodeBlocks build system doesn't output that. Are you using CMake or so as build system?