Author Topic: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)  (Read 139950 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
From

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27067
Quote
Compile errors with multiple inheritance where the stdcall attribute is applied to virtual functions.

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

madd

  • Guest
Great work, TDM, btw.

I got 4.2 to work, but is requires the following (for a simple hello world using iostreams):

Code
C:\tmp>g++ -IC:\mingw\lib\gcc\mingw32\4.2.0\include -IC:\mingw\include\c++\4.2.0
 -LC:\mingw\lib\gcc\mingw32\4.2.0 -IC:\mingw\include\c++\4.2.0\mingw32 -ofoo foo
.cpp

Why the need for the include / lib paths? I'm pretty sure gcc 3.4.5 could find those dirs by itself.

Also the resulting exe is ~1.7MB.  I assuming this is because everything is linked in statically?

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
As Tim mentioned, I used the patch for PR 27067.

Why the need for the include / lib paths? I'm pretty sure gcc 3.4.5 could find those dirs by itself.
They shouldn't be needed. Are you using an older release than tdm-3? Can you post the output from adding "-v" to the command line? Have you tried installing all packages individually into a clean directory?

Also the resulting exe is ~1.7MB.  I assuming this is because everything is linked in statically?
The C++ runtime is linked in statically, yes. If you additionally use some optimization such as "-O2" (for speed) or "-Os" (for size), and the "-s" flag (for "strip"), you'll get a much smaller executable.
« Last Edit: July 05, 2007, 08:16:54 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

madd

  • Guest
Stripping makes it 500KB.  Still pretty big..

It does seem to complain about non existing dirs. Perhaps it is a vista issue?


Code
C:\tmp>g++ -v -IC:\mingw\lib\gcc\mingw32\4.2.0\include -IC:\mingw\include\c++\4.
2.0 -LC:\mingw\lib\gcc\mingw32\4.2.0 -IC:\mingw\include\c++\4.2.0\mingw32 -ofoo
foo.cpp
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.2.0/configure --prefix=/extra/crossgcc/win-gcc --build
=i686-pc-linux-gnu --host=mingw32 --target=mingw32 --enable-languages=c,c++ --wi
th-as=/extra/crossgcc/cross-gcc/bin/mingw32-as --with-ld=/extra/crossgcc/cross-g
cc/bin/mingw32-ld --disable-shared --with-gcc --with-gnu-as --with-gnu-ld --disa
ble-debug --disable-nls --enable-threads=win32 --disable-win32-registry --enable
-sjlj-exceptions --enable-fully-dynamic-string --disable-libstdcxx-pch --with-mt
une=i686 --enable-libgomp
Thread model: win32
gcc version 4.2.0
 cc1plus -quiet -v -IC:\mingw\lib\gcc\mingw32\4.2.0\include -IC:\mingw\include\c
++\4.2.0 -IC:\mingw\include\c++\4.2.0\mingw32 -iprefix c:\tmp\../lib/gcc/mingw32
/4.2.0/ foo.cpp -quiet -dumpbase foo.cpp -mtune=i386 -auxbase foo -version -o ./
ccfAj9ge.s
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../incl
ude/c++/4.2.0"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../incl
ude/c++/4.2.0/mingw32"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../incl
ude/c++/4.2.0/backward"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../incl
ude"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/include"
ignoring nonexistent directory "c:/tmp/../lib/gcc/mingw32/4.2.0/../../../../ming
w32/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include/c++/4.2.0"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include/c++/4.2.0/mingw3
2"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include/c++/4.2.0/backwa
rd"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/lib/gcc/mingw32/4.2.0/in
clude"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
 C:/mingw/lib/gcc/mingw32/4.2.0/include
 C:/mingw/include/c++/4.2.0
 C:/mingw/include/c++/4.2.0/mingw32
 /mingw/include
End of search list.
GNU C++ version 4.2.0 (mingw32)
        compiled by GNU C version 4.2.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 18066f79fca492234e5b690bbee1824d
 as -o ./cc4T7CrJ.o ./ccfAj9ge.s
 ld -Bdynamic -ofoo.exe /mingw/lib/crt2.o -LC:\mingw\lib\gcc\mingw32\4.2.0 -L/mi
ngw/lib ./cc4T7CrJ.o -lstdc++ -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -lus
er32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvc
rt

It is clean install using mingw-runtime-3.12.tar.gz, w32api-3.9.tar.gz, binutils-2.17.50-20070129-1.tar.gz, mingw-utils-0.3.tar.gz and gcc-4.2.0-tdm-3-omp.7z.






blahhh

  • Guest
Once again. Why don't you guys use a vanilla gcc 4.2.0? It works out of the box for me as a mingw compiler.

« Last Edit: July 05, 2007, 09:06:02 pm by blahhh »

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Perhaps it is a vista issue?
Yes, it is a Vista issue. If you need to be able to compile from the command line, you can work around it with additional options (the way you are currently) or environment variables such as C_INCLUDE_PATH, CXX_INCLUDE_PATH, and LIBRARY_PATH.

Once again. Why don't you guys use a vanilla gcc 4.2.0?
Because it fails to build wxWidgets. See Tim's post above that links to GCC PR 27067.
« Last Edit: July 05, 2007, 09:09:09 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

blahhh

  • Guest
Once again. Why don't you guys use a vanilla gcc 4.2.0?
Because it fails to build wxWidgets. See Tim's post above that links to GCC PR 27067.
Okay. Thnx.

Any why are you guys using commands like:
Quote
g++ -v -IC:\mingw\lib\gcc\mingw32\4.2.0\include -IC:\mingw\include\c++\4.2.0 -LC:\mingw\lib\gcc\mingw32\4.2.0 -IC:\mingw\include\c++\4.2.0\mingw32
It's bullshit in my opinion to specify the path where to find stdio.h and other default stuff.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Any why are you guys using commands like:
Quote
g++ -v -IC:\mingw\lib\gcc\mingw32\4.2.0\include -IC:\mingw\include\c++\4.2.0 -LC:\mingw\lib\gcc\mingw32\4.2.0 -IC:\mingw\include\c++\4.2.0\mingw32
It's bullshit in my opinion to specify the path where to find stdio.h and other default stuff.
Until GCC is updated to take certain Vista-related considerations into account, people who use Vista will have to either use commands like this or set environment variables. XP, 2000, 98 users do not need this.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline nenin

  • Almost regular
  • **
  • Posts: 202
I read somewhere  in gcc roadmap that since 4.3. mingw will be included as officially supported platform. 

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
TeeDee, I've tried your 4.2. It's good one, for sure
Glad to hear it. :)

- and I never ever have said anything negative towards you or your incredible work.
In fact, I interpret my words as the sign of support for you, and I am pretty surprised by the amount of negativity you've showed in your reply (not just this time). Again, you've exercised decent lack of selectivity when you communicate with people.
I read what you posted, disagreed with at least some of it (and still do), and explained why. No hard feelings; that's just communication.

-John E. / TDM
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
GCC 4.2.0 TDM-4 is now available! Fortran and Objective-C language packages have been added (and the core/C and C++ packages made separate), and all files are now hosted on SourceForge. As always, you should be able to install in almost any directory (I recommend one without spaces), and use it from almost any directory (unless you're running Vista). Please do a clean reinstall to use this version; don't extract it on top of a previous version.

See http://www.tdragon.net/recentgcc/ for details.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Link to sf.net page
http://sourceforge.net/projects/tdm-gcc/

The below line links to the wrong web page, it links to it's own web page.
Quote
Browse all released packages and source packages: SourceForge Download Page.

Tim S
« Last Edit: July 09, 2007, 09:06:26 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

roland

  • Guest
Wait, so, is it possible to compile wxWidgets 2.8.4 with "gcc-4.2.0-tdm-4-core-2" + gcc package on Vista Business 32bit? Cause I've been trying, unsuccessfully. I get a lot of errors from the "../../src/regex/" directory (and many others, so many I don't know what to do with!) and the compile log ends with:

mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1


I've been using information from the following guides:
http://wiki.codeblocks.org/index.php?title=Installing_MinGW_with_Vista
http://wiki.codeblocks.org/index.php?title=Compiling_wxWidgets_2.6.3_to_develop_Code::Blocks_(MSW)

I get a screenful of errors every time I try. I can compile a basic "hello world" command line app in codeblocks but can't compile wxwidgets from the command line... is there something missing from these guides? I'm reading over this thread but nothing has knocked me in the head yet...

Environmental Variables I use atm:
MINGW=C:\MinGW\
GCC_EXEC_PREFIX=C:\MinGW\
PATH=C:\MinGW\bin\;C:\MinGW\mingw32\bin\;C:\MinGW\libexec\gcc\mingw32\4.2.0\;C:\MinGW\lib\bin\
« Last Edit: July 09, 2007, 09:56:39 pm by roland »

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
The below line links to the wrong web page, it links to it's own web page.
Thanks for catching that! Fixed.

Wait, so, is it possible to compile wxWidgets 2.8.4 with "gcc-4.2.0-tdm-4-core-2" + gcc package on Vista Business 32bit? Cause I've been trying, unsuccessfully. I get a lot of errors from the "../../src/regex/" directory (and many others, so many I don't know what to do with!) and the compile log ends with:

mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
It should be possible, as long as you have both the core and g++ packages (plus the mingw-runtime, w32api, binutils, and mingw32-make packages from mingw.org). What would be most helpful in figuring out the problem is the first error message you get. (If you have trouble finding it, try redirecting the output from the mingw32-make command: append " > errlog.txt" to the end of the command, then find errlog.txt in build\msw.)
« Last Edit: July 09, 2007, 10:13:53 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

roland

  • Guest
Thank you. I aplogize for the newbishness, I am trying to get a working mingw setup on vista, and am makin gsure I can compile known-good testcases before I really dig in.

here is the compileline I used (after doing one with clean attached):

Code
mingw32-make -f makefile.gcc  MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release > errorlog.txt

the contents of the log reads:
Code
gcc -c -o gcc_mswudll\wxregex_regcomp.o  -O2 -mthreads  -DHAVE_W32API_H -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__  -D_UNICODE   -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD ../../src/regex/regcomp.c
I am using only the packages you suggest on your site, as linked through your signature (for example I am using the 20060824-1 binutils, not the newer one).
Thanks
« Last Edit: July 09, 2007, 10:15:35 pm by roland »