Code::Blocks Forums

User forums => Help => Topic started by: axelmattauch on November 24, 2022, 05:46:06 pm

Title: TDM-GCC32/64 Clarification
Post by: axelmattauch 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 (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  (http://wiki.codeblocks.org/index.php/File:TDM_Arch.png)   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:

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:

Thank You.

Title: Re: TDM-GCC32/64 Clarification
Post by: gd_on 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).
Title: Re: TDM-GCC32/64 Clarification
Post by: axelmattauch 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.



Title: TDM-GCC32/64 Clarification -> Correction
Post by: axelmattauch 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 ::)
Title: Re: TDM-GCC32/64 Clarification
Post by: gd_on 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++.