Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: spflanze on February 20, 2020, 04:35:14 am

Title: Upgrading to wxWidgets 3.1.3
Post by: spflanze 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
-------------- 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?
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze 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
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
$(#wx.lib)\gcc_dll\mswu
When I attempt to compile my project in Code::Blocks I get the error:
Code
[ 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?


Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.


Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.


Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze 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
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release
It 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?
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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
# 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: sodev 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
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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: sodev 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
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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze on February 22, 2020, 12:22:30 am
I recompiled wxWidgets. This is the batch file I did it with:

Code
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

-------------- 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: sodev on February 22, 2020, 01:54:34 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?
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze 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?
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze 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?
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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 (http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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

Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.

Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze 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.



Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 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.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 on February 26, 2020, 12:45:08 am
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..."

When you change the default compiler you need to select the Compiler in Global Settings and click on "Set as Default" button.

Tim S.
 
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze on February 26, 2020, 03:35:27 am
Changing to  "TDM-GCC-64" in "Project -> Build Options" did it. The compiler is working now.

There still needs to be and adjustment made to the Linker. I get many errors of the form:
Code
C:\Engineering_Software\TIA Designer\src\JunctionCap.cpp|332|undefined reference to `__imp__ZN11wxGridfData13UpdateDisplayEii'|

Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 on February 26, 2020, 04:40:41 am
Without a build log I can not help you.
Edit: Include at most 12 linker error after the linker command.

You are likely missing a library or linking the libraries in the wrong order.

Tim S.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze on February 26, 2020, 05:01:38 am
I re-enabled precompiled headers, and cleaned the project. I only get one error:

Code
||=== Build: Debug in TIA Designer (compiler: TDM-GCC-64) ===|
||error: ld returned 1 exit status|
||=== Build failed: 1 error(s), 0 warning(s) (1 minute(s), 41 second(s)) ===|

There is no message here about what the error was. Maybe there is a clue in the warning messages. There are 308 warnings. This same code compiled and ran before I upgraded from wxWidgets 3.1.2 to 3.1.3, and I did not get these warnings. The below snippet of them shows only one of each error type. For each line in this snippet there are actually many more of same error.

Code
C:\Engineering_Software\TIA Designer\src\wxComboBoxDataFilePD.cpp|16|warning: 'void wxComboBoxDataFilePD::InitDataPointers(PhotoDiode*)' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]|
C:\Engineering_Software\TIA Designer\src\wxComboBoxDataFilePD.cpp|141|warning: 'void wxComboBoxDataFilePD::UpdateDisplayFromDataFile()' redeclared without dllimport attribute after being referenced with dll linkage|
C:\Engineering_Software\TIA Designer\TIA_DesignerMain.cpp|1026|warning: cast between incompatible pointer to member types from 'void (TIA_DesignerFrame::*)(wxCommandEvent&)' to 'wxObjectEventFunction' {aka 'void (wxEvtHandler::*)(wxEvent&)'} [-Wcast-function-type]|
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 on February 26, 2020, 05:08:55 am
Without the Compiler command no one can help you!!

Tim S.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 on February 26, 2020, 05:12:01 am
There is no message here about what the error was. Maybe there is a clue in the warning messages. There are 308 warnings. This same code compiled and ran before I upgraded from wxWidgets 3.1.2 to 3.1.3, and I did not get these warnings. The below snippet of them shows only one of each error type. For each line in this snippet there are actually many more of same error.

I do not believe that! You had no idea what compiler you were using!
You do know that switching from an 32 bit to 64 bit compiler can cause issues!
And, switching compiler versions can cause issues!

I give up I will let someone else waste their time trying to help you!

Tim S.

Title: Re: Upgrading to wxWidgets 3.1.3
Post by: sodev on February 26, 2020, 06:21:30 pm
This same code compiled and ran before I upgraded from wxWidgets 3.1.2 to 3.1.3, and I did not get these warnings.

No. Your original error was that the project used a non-existent compiler / toolchain and failed to execute a missing binary (the compiler). So you did more than "just" upgrade wxWidgets, the previous code also could not be compiled by a missing compiler. Then you did a lot of random changes that did not solve the original error and now you have a huge mess.

Upgrading wxWidgets is quite simple, especially if it's just a patchlevel upgrade, point to the new root directory (if you not simply replaced the contents of the current one) and do a FULL rebuild. That last step is the most "difficult" one, at least in my setup (CodeBlocks + MSVC) a simple Clean + Build / Rebuild in CodeBlocks does NOT remove everything so i manually delete all outputs (which is quite easy for me, because i do an out-of-tree build, i just delete the output folder, all outputs are inside there). Not sure if it works flawless with your setup, but a good candidate to get missed by the Clean step are precompiled headers.

Your warnings don't look like a x86/x64 mismatch, the linker should detect the architecture and spit out a different error / warning message (IIRC gcc does that on Linux). It looks like a static / dynamic mismatch of wxWidgets, you link the static libraries but the project is setup for dynamic libraries or reversed.

Best thing you can do is a fresh checkout of the last known working revision of your project and restart from there. It looks like your orginal project already is quite messy and contains dead settings and i don't know what else, but only upgrading wxWidgets should be an easy task. You should start with that first. And then you can try to switch the compiler and/or architecture, but for that you should better review the current settings and fix them properly.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze on February 27, 2020, 01:13:03 am
I suppressed most warnings. In the build log I see now this:
Code
wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (4 minute(s), 19 second(s))
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze on February 27, 2020, 04:17:34 am
I suppressed most warnings. In the build log I now see this:
Code
wx_pch.h.gch\Debug_TIA Designer_wx_pch_h_gch: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (4 minute(s), 19 second(s))

It is likely the file it complains about was there before, and I missed it, because I payed attention only to what is in red.

I disabled precompiled headers and the above error disappeared. Now there are many other warnings, and errors, that appear in related pairs, such as this:
Code
C:\Engineering_Software\TIA Designer\src\Utilities.cpp|641|warning: 'void wxGridfData::AdjustMinGridHeight()' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]|

C:\Engineering_Software\TIA Designer\src\opamp.cpp|210|undefined reference to `__imp__ZN11wxGridfData19AdjustMinGridHeightEv'|

When I had this compiling in wxWidgets 3.1.2, I did not need to declare anything with dllimport. I did an incorrect change in Code::Blocks configuration to make it expect it. What could that be?
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: stahta01 on February 27, 2020, 04:27:58 am
On windows, this warning is common and can normally be ignored "redeclared without dllimport attribute: previous dllimport ignored".

Tim S.
Title: Re: Upgrading to wxWidgets 3.1.3
Post by: spflanze on February 28, 2020, 04:14:41 am
Quote
Quote from: sodev on February 22, 2020, 01:54:34 am

Code
Quote from: spflanze on February 22, 2020, 12:22:30 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?

This is an option at: Settings => Compiler => Global compiler settings => Build optiuons (tab)
It is the checkbox: "Display build progress percentage in log"