Author Topic: TDM-GCC32/64 Clarification  (Read 231 times)

Offline axelmattauch

  • Single posting newcomer
  • *
  • Posts: 4
TDM-GCC32/64 Clarification
« on: November 24, 2022, 05:46:06 pm »
Until recently, I had no experience with C::B Nighty Builds, using the installable and ready to use 20.03mingw,64 bit version.
Now I installed the Nighty Build CB_20221022_rev12990_win64, and thanks to the detailed documentation, it works fine.

Neverthless I need some clarification about the MinGW installation.
The process description in the following wiki page
http://wiki.codeblocks.org/index.php?title=MinGW_installation#gcc_3.4.4_manual_install
illustrate a MinGW32 installation, and it is not explicitely indicated if this is mandatory or only given as example.
In the     image, the red arrow seems to be mandatory.

Neverthless, It seems to preferable to use a 64 bit build whenever possible, as I did with the 20.03mingw,64 bit version I used before.

Thus I made a lot of tests, installing both TDM-GCC-32 and TDM-GCC-64:
  • "Console application" wizard and some of projects of mine alternatively to produce 32 bits and 64 bits targets
  • "SDL2 project " wizard (resp. with SDL2-2.24.2\i686-w64-mingw32 and SDL2-2.24.2\SDL2-2.24.2\x86_64-w64-mingw32

Obviously to use TDM-GCC-64, the global compiler settings (attachment) and the debugger setting (C:\TDM-GCC-64\bin\gdb64.exe) have to be adapted. I hope, I made the things right.

Anyway both 32bits and 64bits builds seems working well (for these very simple codes!).

My questions  are:
  • Is it licit to use the TDM-GCC-64 as compiler toolchain? Or did some restrictions exist?
  • If minGW64 is OK, are the settings I presumed (Attached picture) the right ones?

Thank You.


Offline gd_on

  • Lives here!
  • ****
  • Posts: 769
Re: TDM-GCC32/64 Clarification
« Reply #1 on: November 25, 2022, 04:03:12 pm »
This page on the wiki has not been updated since 2017. Of course, it's outdated.
Consider this as an example.
It's effectively better to install a 64 bit compiler nowardays, but in some cases you need 32 bit if you also develop for "old" computers, or if you cannot find tools or drivers for a specific hardware.
TDM compiler is a good solution to develop for both 32 and 64 bit (it is multilib, so compatible with both environments). The only problem is that it is a little bit old now: based on gcc 10.3 (and, if I remember well, I had some problems to compile Code::Blocks itself, but I don't remember which ones).
Gcc is now in version 12.2, as you can find on msys2, equation, winlibs, lhmouse... and some other distributions.
Nevertheless, many distributions are not multilib, and you'll have to install 2 compilers's versions into 2 different directories, for 32 and 64 bit (if you need them both of course).
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline axelmattauch

  • Single posting newcomer
  • *
  • Posts: 4
Re: TDM-GCC32/64 Clarification
« Reply #2 on: November 25, 2022, 05:09:00 pm »
 :) Thanks!

Well, if I've installed the TDM toolchain, it is because:
1/ C::B site explain the process very clearly
2/ I had difficulties with alternate solutions.

In any case, the 10.3 gcc is enough recent for my purposes, permitting to build C++20 code.
And undoubtely more recent as the 8.3 revision bundled with the installable C::B release.

Concerning multilib capability, I read in the README file of the TDM distrib, that the TDM64 is multilib, TDM32 not:

      MinGW-w64 64/32-bit Edition
This edition of TDM-GCC is a dual-arch multilib bootstrap of GCC's
x86_64-w64-mingw32 target, built to run on 32-bit or 64-bit Windows and generate
binaries for 32-bit or 64-bit Windows.
In this edition of TDM-GCC, you can use "-m32" and "-m64" to control whether
32-bit or 64-bit binaries are generated. By default (if neither -m32 nor -m64 is
specified), 64-bit binaries will be generated
.

Thus, it seems better to install this edition.




Offline axelmattauch

  • Single posting newcomer
  • *
  • Posts: 4
TDM-GCC32/64 Clarification -> Correction
« Reply #3 on: November 28, 2022, 01:06:51 pm »
Just a matter of selfcorrection...

In my initial post, one of my questions was:
If minGW64 is OK, are the settings I presumed (Attached picture) the right ones?

I'm now quite shure that the proposed settings, while working by miracle, are incorrect.

The "classical" settings given in the new attachment are working, and obviously g++ permits to launch g++.exe etc...

I apologize for the potential trouble.

Explanation: the first time I put these settings, I had some issues, probably due to another mismatch. Thus I tried to adapt savagely the settings ::)

Offline gd_on

  • Lives here!
  • ****
  • Posts: 769
Re: TDM-GCC32/64 Clarification
« Reply #4 on: November 28, 2022, 01:58:27 pm »
No miracle here.
As in many distributions, gcc.exe and x86_64-w64-mingw32-gcc.exe are exactly the same (same size, same content). Just a different name . This is also true for g++.
Windows 10 64 bits (22H2), svn C::B (last version or almost!), wxWidgets 3.2.1, Msys2 Compilers 12.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).