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

Offline spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Upgrading to wxWidgets 3.1.3
« Reply #15 on: February 22, 2020, 05:02:35 am »
I turned off the compilation of the file wx_pch.h. I did this by right clicking on it, and in the pop up menu, unchecking the "Compile file" box at  "Properties => Build (tab"). In that tab the "Link file" checkbox is also unchecked. It still did not compile. It was the same error as before.

The compiler is on the path: C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\ . Here the gcc.exe and g++.exe compilers are used for both compiling wxWidgets, and my application in Code::Blocks. I verified this with the Window 7 command prompt's "where" command. This compiler setup was installed using the file "mingw-w64-install.exe", which was downloaded from https://mingw-w64.org/doku.php. I see now I do not have the latest version of it.

I searched the entire disk drive for the file "mingw32-g++.exe" using the Windows Explorer. I found it in several places, including an embedded development installation. I attempted to find out which of them is executed when I attempt to compile my application in Code::Blocks using the Windows 7 command prompt command "where mingw32-g++.exe". But the where command could not find any instances of it, in spite of the Windows Explorer's search results.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #16 on: February 22, 2020, 06:09:43 am »
What is the CB compiler toolchain path set to?
"Compiler Installation Directory"
Edit2: Settings -> Compiler
Select the correct compiler
Tab: Toolchain Executable


Post the build log; either you are compiling the same file or you are not!

If you are still compiling the old file [wx_pch.h] then you failed to stop compiling it.

Tim S.
« Last Edit: February 22, 2020, 06:29:12 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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #17 on: February 22, 2020, 06:11:57 am »
Code
[  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?

NOTE: If you are using an Custom makefile instead of an normal CB project then you are wasting time asking questions on this website!

Tim S.
« Last Edit: February 22, 2020, 06:17:03 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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #18 on: February 22, 2020, 06:19:46 am »
Please post the contents of the "wx_pch.h" file maybe you have a error in it?

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 spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Upgrading to wxWidgets 3.1.3
« Reply #19 on: February 22, 2020, 10:54:00 pm »
In: Settings => Compiler => Toolchain executables (tab):

Compilers installation directory: C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64
C Compiler: gcc.exe
C++ Compiler: g++.exe
Linker for dynamic libs: gcc.exe
Linker for static libs: ar.exe
Debugger: GDB/CDB debugger: TDM-GCC-64
Resource compiler: windres.exe
Make program: mingw32-make.exe

The path to all of the above was checked using the "..." to the right of the above fields. For all of them they are:
C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin
This same path is what was verified using the "where" command on gcc.exe, and g++.exe, when I checked which compilers compiled wxWidgets.

It appears that unchecking that box did not prevent wx_pch.h being in the compile, as is evident in the build log:
Code
-------------- Build: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------

[  5.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 -IC:\wxWidgets-3.1.3\lib\gcc_dll\mswud -c C:\Engineering_Software\Libraries\cminpack-1.3.6\cpp\dpmpar.cpp -o obj\Debug\Libraries\cminpack-1.3.6\cpp\dpmpar.o
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:\Engineering_Software\Libraries\cminpack-1.3.6\cpp\dpmpar.cpp -o obj\Debug\Libraries\cminpack-1.3.6\cpp\dpmpar.o' in 'C:\Engineering_Software\TIA Designer' failed.
What is an effective way to exclude it? The contents of the wx_pch.h file:
Code
#ifndef WX_PCH_H_INCLUDED
#define WX_PCH_H_INCLUDED

// basic wxWidgets headers
#include <wx/wxprec.h>

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif

#ifdef WX_PRECOMP
    // put here all your rarely-changing header files
#endif // WX_PRECOMP

In project build options for Debug, which is the mode I am trying to compile in now, in the path Build options... => Debug => Search directories (tab) I have listed each tab's content below:
Compiler: $(#wx.lib)\gcc_dll\mswud
Linker: (#wx.lib)\gcc_dll
Resource compiler: (#wx.lib)\gcc_dll

In Global variables the value of wx.lib is blank. The global base is: C:\wxWidgets-3.1.3

I do not recall ever setting up a custom make file. Where do I look to verify it is a normal CB project?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #20 on: February 22, 2020, 11:15:46 pm »
This is wrong; but, not the cause of your problem.
Code
Resource compiler: (#wx.lib)\gcc_dll

Note: You need to add "$(#wx.include)" to both Compiler and Resource compiler.
That might be causing the problem.

To see if using a Custom Makefile look at
Project -> Properties
Tab: Project Settings
Is "This is a custom makefile" checked?

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #21 on: February 22, 2020, 11:23:26 pm »
Remove the compiler option "-include wx_pch.h" from likely the "Other Compiler Options"
Under "Project" -> "Build Options"
Tab: Compiler Settings
Subtab: "Other Compiler Options"
Remember to check both project and target level setting in left hand pane.

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 spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Upgrading to wxWidgets 3.1.3
« Reply #22 on: February 23, 2020, 12:42:07 am »
I did these things as you recommended:
Added the $ sign where it was missing where the global wx was used.
Removed -include wx_pch.h" in "Other Compiler Options"
Added "$(#wx.include)" to both Compiler and Resource compiler.

I verified the checkbox at: Project => Properties => Project Settings (tab) => This is a custom makefile is, and has been, unchecked.

The error I get now:
Code
[  5.3%] mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -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 -IC:\wxWidgets-3.1.3\include -c C:\Software\Libraries\cminpack-1.3.6\cpp\dpmpar.cpp -o obj\Debug\Libraries\cminpack-1.3.6\cpp\dpmpar.o

Execution of 'mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -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 -IC:\wxWidgets-3.1.3\include -c C:\Software\Libraries\cminpack-1.3.6\cpp\dpmpar.cpp -o obj\Debug\Libraries\cminpack-1.3.6\cpp\dpmpar.o' in 'C:\Software\Designer' failed.

This is still showing "-DWX_PRECOMP" in the compile command. Should it?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #23 on: February 23, 2020, 01:45:08 am »
Please figure out where "mingw32-g++.exe" is coming from?
You said the toolchain is set to use "g++.exe".

Edit: Please verify you were looking at the settings for "GNU GCC Compiler" instead of at a different compiler!

Please post the full rebuild log this time.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.
« Last Edit: February 23, 2020, 01:51:34 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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #24 on: February 23, 2020, 01:48:59 am »
This is still showing "-DWX_PRECOMP" in the compile command. Should it?

Look at "#defines" for "WX_PRECOMP" change it to "NOPCH".
Project -> Build Options
Tab: Compiler Settigs
Subtab: #defines

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #25 on: February 23, 2020, 01:53:32 am »
Toolchain settings
Quote
Linker for dynamic libs: gcc.exe

The above setting is only valid for C programming!

Use below for C++ programming
Code
Linker for dynamic libs: g++.exe
« Last Edit: February 23, 2020, 04:27:47 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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #26 on: February 23, 2020, 03:53:29 am »
This is still showing "-DWX_PRECOMP" in the compile command. Should it?

Look at "#defines" for "WX_PRECOMP" change it to "NOPCH".
Project -> Build Options
Tab: Compiler Settigs
Subtab: #defines

You should also add "WXUSINGDLL" to the list of defines since you are using wxWidgets shared/DLL library.

Please attach your cbp file; so, I can look for weird problems.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #27 on: February 23, 2020, 04:10:18 am »
Does the file "C:\Software\Libraries\cminpack-1.3.6\cpp\dpmpar.cpp" really exist?

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 spflanze

  • Almost regular
  • **
  • Posts: 134
Re: Upgrading to wxWidgets 3.1.3
« Reply #28 on: February 25, 2020, 11:25:48 pm »
In "Global compiler settings" the compiler is set for "TDM-GCC-64". Is that the wrong one? I attempted change it to "GNU GCC Compiler". But I find that after I close "Global compiler settings" by clicking on "OK", and then reopen it, that it has, all on its own, reverted to  "TDM-GCC-64". However  "GNU GCC Compiler" does show as the compiler in "Project => Build options..."

I changed the linker to g++.exe

The ""C:\Software\Libraries\cminpack-1.3.6\cpp\dpmpar.cpp" is a simplified a bit one for posting here. But that file does exist in the search path set for it.

I added "WXUSINGDLL"

The current build log:
Code
-------------- Build: Debug in TIA Designer (compiler: GNU GCC Compiler)---------------

[  5.3%] mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP -g -D__WXDEBUG__ -DWXUSINGDLL -Winline -Wall -pg -m64 -g -g3 -I..\Libraries\cminpack-1.3.6 -IC:\wxWidgets-3.1.3\lib\gcc_dll\mswud -IC:\wxWidgets-3.1.3\include -c C:\Engineering_Software\Libraries\cminpack-1.3.6\cpp\dpmpar.cpp -o obj\Debug\Libraries\cminpack-1.3.6\cpp\dpmpar.o
Execution of 'mingw32-g++.exe -Wall -pipe -mthreads -Winvalid-pch -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -DWX_PRECOMP -g -D__WXDEBUG__ -DWXUSINGDLL -Winline -Wall -pg -m64 -g -g3 -I..\Libraries\cminpack-1.3.6 -IC:\wxWidgets-3.1.3\lib\gcc_dll\mswud -IC:\wxWidgets-3.1.3\include -c C:\Engineering_Software\Libraries\cminpack-1.3.6\cpp\dpmpar.cpp -o obj\Debug\Libraries\cminpack-1.3.6\cpp\dpmpar.o' in 'C:\Engineering_Software\TIA Designer' failed.
This time I did not simplify the paths.

The cpb file is attached.




Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Upgrading to wxWidgets 3.1.3
« Reply #29 on: February 25, 2020, 11:34:42 pm »
You need to change the CB Project to use the Compiler "TDM-GCC-64".
Edit: Or you could edit Global setting of the Compiler your project is using.

Project -> Build Options
Make sure the project is selected in left hand pane!
Change the selected compiler to "TDM-GCC-64".

Do a re-build and post the new build log.

Tim S.
« Last Edit: February 26, 2020, 12:13:35 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