Author Topic: Error building wxwidgets projects with GCC 13.2.0 in CB 13421  (Read 5383 times)

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« on: December 30, 2023, 11:43:11 am »
Hi,
       I updated my GCC to 13.2.0, and for building other kind of projects, it has behaved well. But when I try to build a wxwidgets project, it gives me the following errors. One is of Release configuration, and the other is of Debug. Even when I build the CB's template code, it's the same. Could anyone give me some advice? Thanks.
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1563
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #1 on: December 30, 2023, 02:35:11 pm »
You must rebuild wxWidgets with the new compiler.

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #2 on: December 30, 2023, 03:54:02 pm »
Hmm...I'm using the wxWidgets for gcc 13.2.0 built by Xaviou, and these errors occurred. And my gcc is from winlibs.com.
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1563
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #3 on: December 30, 2023, 05:11:12 pm »
Xaviou only posts the monolithic DLL, you need the matching headers and the .a files.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
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 Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #5 on: December 31, 2023, 03:14:20 pm »
(Now I change to the official 3.2.4 release, headers and libraries) It's the same when I build from the command line.

Code
-------------- Build: Debug in Error (compiler: GNU GCC Compiler)---------------

g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IW:\Libraries\wxWidgets-3.2.4\include -IW:\Libraries\wxWidgets-3.2.4\lib\gcc_dll\mswud -c W:\Projects\Working\Error\ErrorApp.cpp -o obj\Debug\ErrorApp.o
g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IW:\Libraries\wxWidgets-3.2.4\include -IW:\Libraries\wxWidgets-3.2.4\lib\gcc_dll\mswud -c W:\Projects\Working\Error\ErrorMain.cpp -o obj\Debug\ErrorMain.o
windres.exe -IW:\Libraries\wxWidgets-3.2.4\include -IW:\Libraries\wxWidgets-3.2.4\lib\gcc_dll\mswud  -J rc -O coff -i W:\Projects\Working\Error\resource.rc -o obj\Debug\resource.res
g++.exe -LW:\Libraries\wxWidgets-3.2.4\lib\gcc_dll -o bin\Debug\Error.exe obj\Debug\ErrorApp.o obj\Debug\ErrorMain.o  obj\Debug\resource.res -mthreads  -lwxmsw32ud_core -lwxbase32ud -mwindows
windres.exe: preprocessing failed.
Process terminated with status 1 (0 minute(s), 6 second(s))
 
{standard input}: Assembler messages:
{standard input}:33499: Error: junk at end of line, first unrecognized character is `.'
{standard input}:40025: Error: junk at end of line, first unrecognized character is `.'
Process terminated with status 1 (0 minute(s), 10 second(s))
 
Process terminated with status 0 (0 minute(s), 10 second(s))
3 error(s), 0 warning(s) (0 minute(s), 10 second(s))
 

Edit:
Now I can successfully build the project with Release configuration, but I can't run the generated program, because it cannot locate program entry point _ZnSt15basic... on libstdc++-6.dll.
« Last Edit: December 31, 2023, 03:24:54 pm by Grit Clef »
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #6 on: December 31, 2023, 06:12:45 pm »
(Now I change to the official 3.2.4 release, headers and libraries) It's the same when I build from the command line.

Code
-------------- Build: Debug in Error (compiler: GNU GCC Compiler)---------------

g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IW:\Libraries\wxWidgets-3.2.4\include -IW:\Libraries\wxWidgets-3.2.4\lib\gcc_dll\mswud -c W:\Projects\Working\Error\ErrorApp.cpp -o obj\Debug\ErrorApp.o
g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IW:\Libraries\wxWidgets-3.2.4\include -IW:\Libraries\wxWidgets-3.2.4\lib\gcc_dll\mswud -c W:\Projects\Working\Error\ErrorMain.cpp -o obj\Debug\ErrorMain.o
windres.exe -IW:\Libraries\wxWidgets-3.2.4\include -IW:\Libraries\wxWidgets-3.2.4\lib\gcc_dll\mswud  -J rc -O coff -i W:\Projects\Working\Error\resource.rc -o obj\Debug\resource.res
g++.exe -LW:\Libraries\wxWidgets-3.2.4\lib\gcc_dll -o bin\Debug\Error.exe obj\Debug\ErrorApp.o obj\Debug\ErrorMain.o  obj\Debug\resource.res -mthreads  -lwxmsw32ud_core -lwxbase32ud -mwindows
windres.exe: preprocessing failed.
Process terminated with status 1 (0 minute(s), 6 second(s))
 
{standard input}: Assembler messages:
{standard input}:33499: Error: junk at end of line, first unrecognized character is `.'
{standard input}:40025: Error: junk at end of line, first unrecognized character is `.'
Process terminated with status 1 (0 minute(s), 10 second(s))
 
Process terminated with status 0 (0 minute(s), 10 second(s))
3 error(s), 0 warning(s) (0 minute(s), 10 second(s))
 

Edit:
Now I can successfully build the project with Release configuration, but I can't run the generated program, because it cannot locate program entry point _ZnSt15basic... on libstdc++-6.dll.

I had this problem once (this year) and it was because I had multiple (conflicting) compiler directories in the systems path used to invoke the compiler and linker.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5493
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #7 on: December 31, 2023, 06:37:05 pm »
in the coming week I might also switch to this compiler set to build CB nigthlies, in case I also have issues I will report back here.

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #8 on: January 01, 2024, 03:28:41 pm »
It seems not that case. I've cleaned all the other compiler setups in my path, but I get the same errors...
Perhaps I will be only able to use gcc 13.1.0...
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #9 on: January 01, 2024, 03:33:43 pm »
Does this path exist "W:\Libraries\wxWidgets-3.2.4\lib\gcc_dll\mswud"?

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 PB

  • Multiple posting newcomer
  • *
  • Posts: 57
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #10 on: January 01, 2024, 06:18:53 pm »
(Now I change to the official 3.2.4 release, headers and libraries) It's the same when I build from the command line.

AFAICT, there is no official wxWidgets 3.2.4 binary release using GCC 13.2 (latest being GCC 12.2 from MSYS2)?

Were wxWidgets really built by the same compiler (or a really compatible one) that you are using for your application? If not, there are bound to be build- and run-time issues.

FWIW, wxWidgets 3.2.4 self-built with GCC 13.2 can be used with application built with GCC 13.2, tested several configurations for my guide.
« Last Edit: January 01, 2024, 06:25:00 pm by PB »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #11 on: January 01, 2024, 08:38:28 pm »
Till you post the current compiler and OS information I will stop trying to help you.
Please include whether 32 or 64 bit; please include MINGW32, MINGW64, or UCRT64 if using MSys2 compiler.
« Last Edit: January 01, 2024, 11:18:14 pm 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: 7591
    • My Best Post
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #12 on: January 01, 2024, 08:41:36 pm »
(Now I change to the official 3.2.4 release, headers and libraries) It's the same when I build from the command line.

AFAICT, there is no official wxWidgets 3.2.4 binary release using GCC 13.2 (latest being GCC 12.2 from MSYS2)?

Were wxWidgets really built by the same compiler (or a really compatible one) that you are using for your application? If not, there are bound to be build- and run-time issues.

FWIW, wxWidgets 3.2.4 self-built with GCC 13.2 can be used with application built with GCC 13.2, tested several configurations for my guide.

It builds and runs for MSys2 MINGW64; I was surprised.
Code
-------------- Clean: Debug in gcc_mingw64 (compiler: GNU GCC Compiler)---------------

Cleaned "gcc_mingw64 - Debug"
Running project pre-build steps
gcc --version
gcc (Rev3, Built by MSYS2 project) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-------------- Build: Debug in gcc_mingw64 (compiler: GNU GCC Compiler)---------------

g++.exe -pipe -mthreads -Wall -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -D__WXDEBUG__ -IH:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\include -IH:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\lib\gcc1220_x64_dll\mswud -c H:\devel\wxwidgets_libs\test\gcc12\gcc12App.cpp -o obj\Debug\gcc12App.o
g++.exe -pipe -mthreads -Wall -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -g -D__WXDEBUG__ -IH:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\include -IH:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\lib\gcc1220_x64_dll\mswud -c H:\devel\wxwidgets_libs\test\gcc12\gcc12Main.cpp -o obj\Debug\gcc12Main.o
windres.exe -IH:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\include -IH:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\lib\gcc_dll\mswud  -J rc -O coff -i H:\devel\wxwidgets_libs\test\gcc12\resource.rc -o obj\Debug\resource.res
g++.exe -LH:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\lib\gcc1220_x64_dll -o bin\Debug\gcc12.exe obj\Debug\gcc12App.o obj\Debug\gcc12Main.o  obj\Debug\resource.res -mthreads  -lwxmsw32ud_core -lwxbase32ud
H:\devel\wxwidgets_libs\test\gcc12\gcc12Main.cpp: In constructor 'gcc12Dialog::gcc12Dialog(wxDialog*, const wxString&)':
H:\devel\wxwidgets_libs\test\gcc12\gcc12Main.cpp:58:70: warning: 'wxFont::wxFont(int, int, int, int, bool, const wxString&, wxFontEncoding)' is deprecated: use wxFONT{FAMILY,STYLE,WEIGHT}_XXX constants ie: wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD [-Wdeprecated-declarations]
   58 |     m_staticText1->SetFont(wxFont(20, 74, 90, 90, false, wxT("Arial")));
      |                                                                      ^
In file included from H:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\include/wx/font.h:627,
                 from H:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\include/wx/window.h:23,
                 from H:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\include/wx/wx.h:38,
                 from H:\devel\wxwidgets_libs\test\gcc12\gcc12Main.h:14,
                 from H:\devel\wxwidgets_libs\test\gcc12\gcc12Main.cpp:14:
H:\devel\wxwidgets_libs\wxMSW-3.2.4_gcc1220_x64_Dev\include/wx/msw/font.h:130:5: note: declared here
  130 |     wxFont(int size,
      |     ^~~~~~
Output file is bin\Debug\gcc12.exe with size 1.12 MB
Process terminated with status 0 (0 minute(s), 7 second(s))
0 error(s), 1 warning(s) (0 minute(s), 7 second(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 Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #13 on: January 02, 2024, 05:10:01 am »
Compiler info: GCC 13.2.0 (with POSIX threads) dwarf + MinGW-w64 11.0.1 (UCRT) - release 3
OS: Windows 7 Ultimate 32-bit with Service Pack 1
I haven't used Msys2, because it doesn't support 32-bit systems.
My wxWidgets is just downloaded from wxWidgets' github repository, there's one for gcc1320 that the binaries wxWidgets provide contain.
"W:\Libraries\wxWidgets-3.2.4\lib\gcc_dll\mswud"does exist, originally there's a directory named gcc1320_dll, and I changed it to gcc_dll(Is this wrong?).
I think maybe I should compile wxWidgets myself when necessary, but on my old computer it's very slow...
« Last Edit: January 02, 2024, 05:29:28 am by Grit Clef »
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #14 on: January 02, 2024, 05:51:23 am »
Compiler info: GCC 13.2.0 (with POSIX threads) dwarf + MinGW-w64 11.0.1 (UCRT) - release 3
OS: Windows 7 Ultimate 32-bit with Service Pack 1
I haven't used Msys2, because it doesn't support 32-bit systems.
My wxWidgets is just downloaded from wxWidgets' github repository, there's one for gcc1320 that the binaries wxWidgets provide contain.
"W:\Libraries\wxWidgets-3.2.4\lib\gcc_dll\mswud"does exist, originally there's a directory named gcc1320_dll, and I changed it to gcc_dll(Is this wrong?).
I think maybe I should compile wxWidgets myself when necessary, but on my old computer it's very slow...

You might need to build it yourself or use a GCC compiler that was used to build the wxWidgets library. Mixing UCRT with non UCRT is not likely to work. Mixing GCC versions might work or might not.

Edit5: I was guessing that the wxwidgets you downloaded was non UCRT; this can likely be the cause of the weird errors.
Edit4: Building using UCRT64 GCC compiler under MSys2 (using MINGW64 [non-UCRT] wxWidgets) resulted in a run-time error; so, not sure now what caused your error.

Edit3: Renaming "gcc1320_dll" to "gcc_dll" should work okay.

Tim S.
« Last Edit: January 02, 2024, 09:18: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 Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #15 on: January 02, 2024, 11:19:40 am »
Thank you. The compiler set is just from winlibs.com, I think it may not mix the different versions of gcc, but  pack gcc and some Windows headers and libraries from MinGW-w64, then make them work together.
Oh, I remember that the gcc I used before was built with msvcrt, later I'll build wxWidgets myself.
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #16 on: January 14, 2024, 07:10:26 am »
This problem still happened from time to time even though I build wxWidgets myself. And I find if I disable the -pipe compiler switch, things will be all right. I think maybe the compiler caused the problem.
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version

Offline nenin

  • Almost regular
  • **
  • Posts: 212
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #17 on: January 14, 2024, 09:54:03 am »
Hmm...I'm using the wxWidgets for gcc 13.2.0 built by Xaviou, and these errors occurred. And my gcc is from winlibs.com.
From the my experience, all C++ libraries should be-rebuild after the changing of the compiler version. Otherwise strange things may happen. UCRT must not be mixed with MSVCRT (and better to forget MSVCRT, if target is not older than WinXP ).
For alien binaries it is necessary to check: compiler version (for C++), MinGW_64w version,  UCRT/MSVCRT, threads model and  unwind model (different ones  simply dont link together).
 

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 61
  • Where there is a will, there is a way.
Re: Error building wxwidgets projects with GCC 13.2.0 in CB 13421
« Reply #18 on: January 15, 2024, 11:59:47 am »
Yes, I've rebuilt the wxWidgets using my compiler, but if I compile source files with -pipe, then it'll fail.
-Windows 7, 32-bit
-CodeBlocks r13490, gcc 13.2.0, debug version