News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Upgrading to wxWidgets 3.1.3

Started by spflanze, February 20, 2020, 04:35:14 AM

Previous topic - Next topic

spflanze

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.

stahta01

#16
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

#17
Quote from: sodev on February 22, 2020, 01:54:34 AM
Quote from: spflanze on February 22, 2020, 12:22:30 AM

[  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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

spflanze

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:

-------------- 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:
#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?

stahta01

This is wrong; but, not the cause of your problem.

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

spflanze

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:
[  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?

stahta01

#23
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

Quote from: spflanze on February 23, 2020, 12:42:07 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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

#25
Toolchain settings
Quote
Linker for dynamic libs: gcc.exe

The above setting is only valid for C programming!

Use below for C++ programming

Linker for dynamic libs: g++.exe
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

Quote from: stahta01 on February 23, 2020, 01:48:59 AM
Quote from: spflanze on February 23, 2020, 12:42:07 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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

spflanze

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:

-------------- 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.




stahta01

#29
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.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]