Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: TDragon on May 18, 2007, 11:36:45 pm

Title: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on May 18, 2007, 11:36:45 pm
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.


====== Older =======

By popular request, I have made OpenMP available in my GCC 4.2.0 binary package (the "-fopenmp" option). See http://www.tdragon.net/recentgcc/ for details.

------------------------

I have built a C and C++ binary distribution of GCC 4.2.0 as a drop-in replacement for MinGW's gcc-core and gcc-g++ packages. See http://www.tdragon.net/recentgcc.html (http://www.tdragon.net/recentgcc.html) for details.

For a list of changes from the GCC 4.1 series, see http://gcc.gnu.org/gcc-4.2/changes.html (http://gcc.gnu.org/gcc-4.2/changes.html).

As usual, I have tested this build by compiling wxWidgets and Code::Blocks, and everything works great!

Due to the popularity of my previous GCC 4.1.2 build, I had to stop hosting it on my website's server, leaving FileFront as the only option. However, a couple of people have complained that the FileFront download doesn't work for them. If you can provide a mirror for the binary and source packages (a 3-MB file and a 70-MB file), please email me at tdragon-at-tdragon-dot-net -- those users and I would appreciate it.

Cheers,
John E. / TDM
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: AmR EiSa on May 19, 2007, 03:08:01 am
Hello

 :?

did u try build console app by c++ by it ?

by this code only :(

Code
#include <iostream>

using namespace std;

int main()
{
cout << "Hello world!" << endl;
return 0;
}

i got that error
c:\program files\codeblocks\bin\..\lib\gcc\mingw32\4.2.0\..\..\..\..\include\c++\4.2.0\cwctype:90: error: '::iswblank' has not been declared
:: === Build finished: 1 errors, 0 warnings ===

it's very strang :(

i have last build

AmR EiSa
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on May 19, 2007, 03:49:17 am
That code compiles and runs fine for me. Have you made any modifications to your installation? Have you tried installing all the necessary packages from scratch in an empty directory?
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: snija on May 19, 2007, 04:32:35 am
why no gomp?
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on May 19, 2007, 04:39:06 am
I hadn't even heard of "GOMP" until you mentioned it and I looked it up. I still don't know what relation it has to GCC. Could you explain it?
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: snija on May 19, 2007, 05:18:49 am
gomp stands up for GNU Open MP
gcc 4.2 is the first version which supports this feature.
http://gcc.gnu.org/onlinedocs/gcc-4.2.0/libgomp/
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on May 19, 2007, 05:55:55 am
Well then, have you tried "-fopenmp"? (http://gcc.gnu.org/onlinedocs/gcc-4.2.0/libgomp/Enabling-OpenMP.html)
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: snija on May 19, 2007, 06:22:36 am
Unfortunately, there`s no libgomp.a in lib directory.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 19, 2007, 02:10:13 pm
I too have errors compiling the above mentioned simplest console program:

#include <iostream>

using namespace std;

int main()
{
   cout << "Hello world!" << endl;
   return 0;
}


...and got the following errors in CodeBlocks:
Code
:: === consoleTest, Release ===
obj\Release\main.o:main.cpp:(.text+0x30):: undefined reference to `std::ios_base::Init::Init()'
obj\Release\main.o:main.cpp:(.text+0x3e):: undefined reference to `std::ios_base::Init::~Init()'
obj\Release\main.o:main.cpp:(.text+0x99):: undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0x9e):: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
obj\Release\main.o:main.cpp:(.text+0xa5):: undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0xaa):: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
:: === Build finished: 6 errors, 0 warnings ===

I did install TDragons gcc-4.1.2-mingw-setup.exe into a new directory, which should include all the necessary packages (except gdb) and just copied the files from gcc-4.2.0-tdm-1.7z over it. I manually replaced the gcc4.1.2 files in the bin directory with those from 4.2 and did the same in Codeblocks.

So, what is wrong??
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on May 19, 2007, 04:05:31 pm
@snija:
I'm afraid I have no idea what to do differently in order to have libgomp.a created; if you find out, though, I'd be more than happy to do a rebuild.

@patlecat:
I do not distribute "gcc-4.1.2-mingw-setup.exe"; I believe you're referring to Giovanni's installer available from http://www.develer.com/oss/GccWinBinaries. In any case, it may be that some files from the 4.1.2 package are confusing the new 4.2.0 package, so you should try installing it in a directory that doesn't already have a gcc package installed.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Outis on May 19, 2007, 04:40:17 pm
The build works fine for me, thank you!
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 19, 2007, 08:17:37 pm
@patlecat:
I do not distribute "gcc-4.1.2-mingw-setup.exe"; I believe you're referring to Giovanni's installer available from http://www.develer.com/oss/GccWinBinaries. In any case, it may be that some files from the 4.1.2 package are confusing the new 4.2.0 package, so you should try installing it in a directory that doesn't already have a gcc package installed.

TDragon: First of all I must thank you for your outstanding work I really appreciate it! :P

I did not mention, that I could compile wxWidgets 2.8.4 with that configuration and that I can create programs out of Dialogblocks with no problem at all!!
But somehow nothing ever compiled in Codeblocks, neither with gcc4.1.2 nor 4.2 :(


BTW u mention a "All-in-One Installer" made by Giovanni, but all I found was the 4.1.2 installer. Nothing for 4.2 yet.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on May 19, 2007, 09:47:15 pm
Giovanni's all-in-one installer does indeed use my GCC 4.1.2 package rather than the new 4.2.0, so if you really want to use 4.2.0 you'll have to do things by hand as outlined on my information page and in the readme.

If you reinstall the necessary packages in an empty directory and still get errors, post them and I'll see about helping you to resolve them.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 19, 2007, 10:20:32 pm
Thanks for the kind offer man, but dont you find it strange that such a complex  lib like wxWidgets can be compiled with no flaws and that another tool namely Dialogblocks compiles everything just fine - whereas CodeBlocks is unable to compile even the simplest of all programs??

So what would that reinstall bring me other than just a lot of work? What could be a good reason to do it?
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: stahta01 on May 19, 2007, 11:55:40 pm
Thanks for the kind offer man, but dont you find it strange that such a complex  lib like wxWidgets can be compiled with no flaws and that another tool namely Dialogblocks compiles everything just fine - whereas CodeBlocks is unable to compile even the simplest of all programs??

So what would that reinstall bring me other than just a lot of work? What could be a good reason to do it?

Since, you do not know the difference between an IDE and an Compiler, I have no idea if it will bring you anything.

If you want help to confirm the cause of the problem, try turning on the Code::Blocks option for the compiler to do full compiler logging. This would help to see if it's an Compiler issue or a Code::Blocks setting that needs adjustment.

Steps to turn on Compiler Logging:
"Settings" -> "compiler debugger"
Change "Compiler Settings" to "Other Settings"
Set "Compiler Logging" to "Full Command Line"

Tim S
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 19, 2007, 11:59:00 pm
Since, you do not know the difference between an IDE and an Compiler, I have no idea if it will bring you anything.

Tim S
Oho an angry message from an angry man  :lol: But thanks for the logging tip. And I do have no experience with CodeBlocks, that is true.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: stahta01 on May 20, 2007, 12:01:59 am
Since, you do not know the difference between an IDE and an Compiler, I have no idea if it will bring you anything.

Tim S
Oho an angry message from an angry man  :lol: But thanks anyways for nothing.

It was not angry, it just showed you that I thought you do NOT know as much as you think you do.
I retract my offer to help.

Tim S
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 20, 2007, 12:40:57 am
ok this is the full compiler log:
Code
mingw32-gcc-4.2.0.exe -Lh:\MinGW\lib -LH:\wxWidgets-2.8.4\lib -LH:\wxWidgets-2.8.4\lib\gcc_lib -o bin\Release\consoleTest.exe obj\Release\main.o -s -s
obj\Release\main.o:main.cpp:(.text+0x30): undefined reference to `std::ios_base::Init::Init()'
obj\Release\main.o:main.cpp:(.text+0x3e): undefined reference to `std::ios_base::Init::~Init()'
obj\Release\main.o:main.cpp:(.text+0x99): undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0x9e): undefined reference to `std::basic_ostream >& std::__ostream_insert >(std::basic_ostream >&, char const*, int)'
obj\Release\main.o:main.cpp:(.text+0xa5): undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0xaa): undefined reference to `std::basic_ostream >& std::endl >(std::basic_ostream
> >&)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
6 errors, 0 warnings

As I said before I don't think that this is a problem of TDragons GCC4.2 but rather of CodeBlocks.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: stahta01 on May 20, 2007, 12:58:06 am
Hello

 :?

did u try build console app by c++ by it ?

by this code only :(

Code
#include <iostream>

using namespace std;

int main()
{
cout << "Hello world!" << endl;
return 0;
}

i got that error
c:\program files\codeblocks\bin\..\lib\gcc\mingw32\4.2.0\..\..\..\..\include\c++\4.2.0\cwctype:90: error: '::iswblank' has not been declared
:: === Build finished: 1 errors, 0 warnings ===

it's very strang :(

i have last build

AmR EiSa


@TDragon and AmR EiSa

I installed mingw-runtime-3.11.tar.gz over my minGW installation and it fixed the problem.

Before that it was mingw-runtime-3.10.tar.gz which is the default minGW candidate runtime right now.

Tim S

You may need to edit c++config.h header in include\c++\4.2.0\mingw32\bits

It maybe correct to comment out _GLIBCXX_HAVE_ISWBLANK.
I think someone needs to confirm or deny whether libstdc++ has the iswblank fuction.
It's beyond my current knowledge level.
If, libstdc++ does not have iswblank then commentting out the define of _GLIBCXX_HAVE_ISWBLANK seems to fix the issue.

Note, I could not find the debug version of libstdc++, but no idea if that relates to this issue or not.
The GLIB seems to be is called libstdc++ in minGW GCC.

Possibly Bad code below, that causes error message of "'::iswblank' has not been declared" on my computer.

/* Defined if iswblank exists. */
#define _GLIBCXX_HAVE_ISWBLANK 1


Possibly Fixed code in c++config.h below; this fixes the error on my computer.
/* Define to 1 if you have the `iswblank' function. */
/* #undef _GLIBCXX_HAVE_ISWBLANK */


Tim S


Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: heromyth on May 20, 2007, 04:55:54 am
I too have errors compiling the above mentioned simplest console program:

#include <iostream>

using namespace std;

int main()
{
   cout << "Hello world!" << endl;
   return 0;
}


...and got the following errors in CodeBlocks:
Code
:: === consoleTest, Release ===
obj\Release\main.o:main.cpp:(.text+0x30):: undefined reference to `std::ios_base::Init::Init()'
obj\Release\main.o:main.cpp:(.text+0x3e):: undefined reference to `std::ios_base::Init::~Init()'
obj\Release\main.o:main.cpp:(.text+0x99):: undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0x9e):: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, int)'
obj\Release\main.o:main.cpp:(.text+0xa5):: undefined reference to `std::cout'
obj\Release\main.o:main.cpp:(.text+0xaa):: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
:: === Build finished: 6 errors, 0 warnings ===

So, what is wrong??

I think this problem exists in the most of Unofficial GCC for MinGW.  To use it correctly, you must know the place where the the OLD MingW which is used to build the new Unofficial one locate. If you place Unofficial one at wrong place, you may get these errors. For example, my OLD MingW is in D:\mingw, so my new built MingW should be there.

I have ever built a copy gcc. That's what I have found. However, I havn't yet found what happens to this :(.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: stahta01 on May 20, 2007, 05:06:08 am
FYI:

This is my Windows XP Batch file I use to get setting of my minGW Setups.
Adjust set MINGWBASEDIR= to your minGW install folder.

version-of-mingw.bat
Code
::
:: Display the current version of GCC, NASM, ld, make and others.
::
@echo off
set MINGWBASEDIR=C:\apps\gcc-4.2.0-tdm-1
SET PATH=%MINGWBASEDIR%\bin;%SystemRoot%\system32
gcc -v 2>&1 | find "gcc version"
REM nasm -v
ld -v
windres --version | find "GNU windres"
mingw32-make -v | find "GNU Make"
type "%MINGWBASEDIR%\include\_mingw.h" | find "#define __MINGW32_VERSION"
type "%MINGWBASEDIR%\include\w32api.h" | find "__W32API_VERSION"

PAUSE

Output on my Computer

Code
gcc version 4.2.0
GNU ld version 2.17.50 20060824
GNU windres 2.17.50 20060824
GNU Make 3.80
#define __MINGW32_VERSION 3.11
#define __W32API_VERSION 3.7
Press any key to continue . . .
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: snija on May 20, 2007, 05:28:24 am
../libgomp/configure --program-suffix=-4.2 --host=i686-pc-mingw32 --build=i686-pc-linux-gnu --target=i686-pc-mingw32 --prefix=/mingw --enable-optimize --enable-threads=win32 --disable-nls --disable-win32-registry --enable-static --without-x
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on May 20, 2007, 05:58:07 am
@patlecat:
The problem is in your compiler settings in Code::Blocks, apparently. The (correct) default is for it to use mingw32-g++.exe to link your program: the g++ driver ensures that necessary libraries for C++ programs are linked in, whereas the gcc driver requires them to be linked explicitly. Since I don't know what other changes you've made, I would like it best if you could completely reset your compiler settings in C::B. If that's not an option for you, at least make sure that, as mentioned above, mingw32-g++.exe is being used rather than mingw32-gcc-4.2.0.exe.

@snija:
Thanks for the info! I will probably attempt a libgomp build tomorrow, along with GFortran and GCJ. If it goes smoothly, I'll find a way of making it available.

@heromyth:
The issue that you mentioned is certainly present in many other unofficial builds, but I've taken pains to guarantee that it is not the case for mine! (If it were the case, no one would be able to use this build, because it was built in "/extra/crossgcc" a Linux environment!) You can feel free to install it anywhere, and call it from anywhere.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 20, 2007, 09:33:53 am
@patlecat:
The problem is in your compiler settings in Code::Blocks, apparently. The (correct) default is for it to use mingw32-g++.exe to link your program: the g++ driver ensures that necessary libraries for C++ programs are linked in, whereas the gcc driver requires them to be linked explicitly. Since I don't know what other changes you've made, I would like it best if you could completely reset your compiler settings in C::B. If that's not an option for you, at least make sure that, as mentioned above, mingw32-g++.exe is being used rather than mingw32-gcc-4.2.0.exe.
AHHHH you're a genius man :P That worked, it compiles! I'm not accustomed to the GCC suite, yet. Unfortunately now the program wont run and I have this system error:
Code
The procedure entry point _ctype count not be located in the dynamic link library msvcr71.dll
(I have VC2k3 installed so msvcr71.dll is installed on my pc)

And if I may also ask about the linker error I have when I try to compile the default wxWidgets project? There I get this error:
Code
cc1plus.exe: warning: ./wx_pch.h.gch/Debug_wx_pch_h_gch: created by a different GCC executable
Linking executable: bin\Release\wixTest3.exe
h:/mingw/bin/../lib/gcc/mingw32/4.2.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw28
collect2: ld returned 1 exit status
(I've had this problem from the beginning, a few weeks ago, when I first installed a nightly build of CB. And yes, both wxWidgets and this test program were built with the same compiler suite.)

PS: I've rebuilt/cleaned both projects several times


@TimS_: Kool script man, thanx. I've gotten this out of it:
Code
gcc version 4.2.0
GNU ld version 2.17.50 20060824
GNU windres 2.17.50 20060824
GNU Make 3.81
#define __MINGW32_VERSION 3.11
#define __W32API_VERSION 3.7
Press any key to continue . . .
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 20, 2007, 09:56:38 am
AHHHH you're a genius man :P That worked, it compiles! I'm not accustomed to the GCC suite, yet. Unfortunately now the program wont run and I have this system error:
Code
The procedure entry point _ctype count not be located in the dynamic link library msvcr71.dll
This problem was solved by installing mingwRuntime 3.11, like TimS suggested, thanks Tim :P


BTW TDragon, why didn't u use 3.12? Is it buggy?
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 20, 2007, 11:04:27 am
Things are getting weirder by the minute. I've rebuilt wxWidgets 2.8.4 after I copied runtime3.11 over the installation again. Then my wx project showed the same error but I noticed that it used the 2.8.3 directories, although I changed them to 2.8.4 in CB!
Ok so I deleted it and created a new default wxW project and now I have these totally different errors.... CB is driving me crazy :roll:

Code
mingw32-gcc-4.2.0.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -Winvalid-pch -include wx_pch.h -DWX_PRECOMP -Wall -g -march=athlon-xp -O3 -W -pg -g -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib\gcc_lib\msw -Ih:\MinGW\include -IH:\wxWidgets-2.8.4\include -IH:\wxWidgets-2.8.4\include\wx\msw -IH:\wxWidgets-2.8.4\contrib\include -IH:\wxWidgets-2.8.4\lib -IH:\wxWidgets-2.8.4\lib\gcc_lib -c H:\myProjects2\wixTest\wx_pch.h -o wx_pch.h.gch\Debug_wx_pch_h_gch
In file included from H:/wxWidgets-2.8.4/include/wx/defs.h:21,
from H:/wxWidgets-2.8.4/include/wx/wxprec.h:13,
from ./wx_pch.h:14,
from :0:
H:/wxWidgets-2.8.4/include/wx/platform.h:196:22: error: wx/setup.h: No such file or directory
In file included from H:/wxWidgets-2.8.4/include/wx/platform.h:279,
from H:/wxWidgets-2.8.4/include/wx/defs.h:21,
from H:/wxWidgets-2.8.4/include/wx/wxprec.h:13,
from ./wx_pch.h:14,
from :0:
H:/wxWidgets-2.8.4/include/wx/chkconf.h:98:9: error: #error "wxUSE_DYNLIB_CLASS must be defined."
H:/wxWidgets-2.8.4/include/wx/chkconf.h:106:9: error: #error "wxUSE_EXCEPTIONS must be defined."
H:/wxWidgets-2.8.4/include/wx/chkconf.h:114:9: error: #error "wxUSE_FILESYSTEM must be defined."
H:/wxWidgets-2.8.4/include/wx/chkconf.h:122:9: error: #error "wxUSE_FS_ARCHIVE must be defined."
...
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h: In function 'wxSetCCUnicodeFormat':
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:48: error: expected expression before ':' token
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:45: warning: unused parameter 'hwnd'
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h: At top level:
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:58: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxFont'
H:/wxWidgets-2.8.4/include/wx/msw/wrapcctl.h:59: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'wxGetCCDefaultFont'
...

When creating a new wxW project, the wizard always says:  A matching Debug/Release configuration cannot be found in the wxWidges directory you specified. This means that Debug/Release target of your project will not be built.
But I gave the right directory both in the wizard (why does he need that anyway??) and in the Settings-GlobalVariables.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Biplab on May 20, 2007, 11:32:13 am
When creating a new wxW project, the wizard always says:  A matching Debug/Release configuration cannot be found in the wxWidges directory you specified. This means that Debug/Release target of your project will not be built.
But I gave the right directory both in the wizard (why does he need that anyway??) and in the Settings-GlobalVariables.

Wizard needs that directory to setup your project properly. The error message indicates that your wxWidgets installation is not perfect. It has some fault. GCC fails due to that.

Please check if the appropriate libraries are built properly inside the wx directory that you are specifying. That should solve your problem.

Regards,

Biplab
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 20, 2007, 11:38:11 am
Wizard needs that directory to setup your project properly. The error message indicates that your wxWidgets installation is not perfect. It has some fault. GCC fails due to that.

Please check if the appropriate libraries are built properly inside the wx directory that you are specifying. That should solve your problem.
Wizard doesn't need to ask what is already set in the "Settings" of CB, but maybe there is another reason for this?

I have checked the libs and they are fine. Dialogblocks compiled my test project just fine with the actual installation. No errors during or after the compile. I still suspect that CB messes up with directories or something else.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Biplab on May 20, 2007, 11:47:49 am
Wizard doesn't need to ask what is already set in the "Settings" of CB, but maybe there is another reason for this?

Wizard asks it as user may keep the wx to a different directory. The path is used as the base path to setup project.

If Dialogblocks can compile your project then it should get compiled with C::B. Please check the settings that you're using. The project will be setup based on your settings choice.

In short the error you are getting is due to settings mismatch.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 20, 2007, 12:12:24 pm
Ok so you're saying that the Wizard can override the general settings for a new project? But if I dont want to change it, then I shouldn't be asked to do it, i find this confusing. Maybe a radio button would help here "Use actual wxW" and "Use different wxW".

Also I find it difficult to understand why there is no clear instruction on what directories need to be included and where? Or why not fill the necessary fields automatically once u know the base dir of wxW?

My wxW settings are as follows:
Settings - Global Variables (variable: wx) :
base:      H:\wxWidgets-2.8.4
include:   H:\wxWidgets-2.8.4\include
lib:       H:\wxWidgets-2.8.4\lib\gcc_lib


plus in the Compiler Settings I have these additional directories:
Search directories:
++ Compiler
H:\wxWidgets-2.8.4\include
H:\wxWidgets-2.8.4\include\wx\msw
H:\wxWidgets-2.8.4\contrib\include
H:\wxWidgets-2.8.4\lib
H:\wxWidgets-2.8.4\lib\gcc_lib

++ Linker
H:\wxWidgets-2.8.4\lib
H:\wxWidgets-2.8.4\lib\gcc_lib

++ Resource compiler
h:\MinGW\include
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Biplab on May 20, 2007, 12:31:58 pm
Maybe a radio button would help here "Use actual wxW" and "Use different wxW".

That would be lot confusing to new users.

The way you've setup the Global variable basically restricts your choice. It's OK if you're happy with the configuration. The only missing is the include directory of setup.h which remains inside H:\wxWidgets-2.8.4\lib\gcc_lib\msw or H:\wxWidgets-2.8.4\lib\gcc_lib\mswd or similar directory depending upon your configuration.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on May 20, 2007, 12:41:28 pm
Setup.h is in include/wx/msw which I had defined already (s. above). I added the mswu and mswud directory to the linker path. But I still get the same errors.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Biplab on May 20, 2007, 12:49:02 pm
Setup.h is in include/wx/msw which I had defined already (s. above).

Every time you compile wx a new setup.h file is created which reflects the build configuration. That setup.h file is necessary for proper compilation. So you've to point towards the created setup.h file, not the default one.

I added the mswu and mswud directory to the linker path. But I still get the same errors.

The directories shall be added to Compiler, not to linker.

To avoid hijacking this thread, please start a new thread if you still face problem.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on May 20, 2007, 08:32:55 pm
@snija, an update on libgomp:
Configuring fails with the error "Pthreads are required to build libgomp". After poking around in the main GCC configure script, I see that compilation of libgomp is automatically disabled on non-POSIX systems for this reason. MinGW32 programs are expected to use Win32 threads directly, though I expect there are pthreads ports for MinGW available. Feel free to build libgomp yourself with one of these ports; or, if you find an easy method of having libgomp use Win32 threads, I'll try it.

Cheers,
John E. / TDM
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: stahta01 on May 21, 2007, 05:44:38 am
As usual, I have tested this build by compiling wxWidgets and Code::Blocks, and everything works great!

FYI: Your new 4.2.0 (3.4.5 works perfectly) has problems building wxWidgets 2.9.x CVS-Head; It has 4 or 5 minor compile errors that are easy to fix. If anybody wants the work-around patches to wxWidgets PM me; and I will upload them or post them. Note, the wx developers fixes this type issues in a completely different way. (The bugs are all related to the wxString redesign, I only know enough to patch them by adding casts to variables; they fix them by editing an function somewhere to do it all automatically.)

Please DO NOT bug the wx developers with this; wait till an official minGW 4.2.0 release is done.

Tim S
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: snija on May 21, 2007, 03:32:10 pm
That`s not true, for people stick to science computation(like gfortran) and target to dual core and quad core cpu , it`s the most easiest way to utilize the resource you have.
Another important feature in the coming version is auto-vectorize .
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Soultaker on May 29, 2007, 10:52:08 pm
I tried to use this build, but unfortunately it's missing OpenMP support, which was the specific reason why I wanted to use GCC 4.2 under Windows. OpenMP is an important feature, in my opinion, especially since GCC I believe is the first free compiler to offer it on Windows. (Microsoft Visual C/C++ compiler has OpenMP support, but the free version does not include the necessary libraries.)

20-40 has posted a more complete build of GCC 4.2 here: GCC4.2 (http://forums.codeblocks.org/index.php/topic,5923.msg45791.html#msg45791); it has working OpenMP support (although I didn't test it extensively, the basics seem to work just fine). It's a lot older, but are there any other issues? Is there a reason to prefer your packages over this one, or vice versa?

Something else: I saw you needed a mirror, so I put the files on my S3 site:
Feel free to link to these on your website.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Soultaker on May 30, 2007, 12:47:36 am
Ah, in retrospect, that seems to be the one that I actually ended up using, not the older release.

So I guess it's just as recent as TDragon's, but with OpenMP support. I'll stick with that one then. Thanks!
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Grom on June 21, 2007, 11:47:03 pm
Recently I tested OpenMP in "MinGW" gcc 4.2.0. On dual core Xeone under WinXP I've got slower code, compare to non parallel version :shock:. With 2005 studio I've got 30% faster code. Probably threading was not don in efficient way...
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Grom on June 27, 2007, 09:30:38 pm
I've combined gcc 4.2.0 from two distributions. One of them had one piece of omp another one had second piece. After that I parallelized the main loop in my program. VC++ gave 30% on two CPUs, gcc nothing with full load of both CPUs. Seems to be the problem is the speed of switching between one CPU usage and 2 CPUs usage. Looks like behind omp was implemented a thread model with new delete for every one parallel subblock.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on June 28, 2007, 04:55:13 pm
@TDragon: I installed ur newest update on GCC4.2 (V2.7), I copied it over my working version (V1.7) but when I tried to compile anything from out of DialogBlocks, it gave me several errors. "File not found" etc. on the String.h file in wxWidgets (V2.8.4).

Reverting back to V1.7 helped and things went smooth again.


What might be the matter? And what exactly did u change, what are the effects of it? :?:
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on June 28, 2007, 05:16:47 pm
And what exactly did u change, what are the effects of it? :?:
Apparently more that I changed had noticeable effects than I expected. :P

I'll do some comparisons, but in the meantime it would help if you could provide an example of something that doesn't work, along with the specific error messages produced.

Edit:
I haven't turned up anything that would seem to cause an error like that, so I eagerly await further details.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: dwmcqueen on June 28, 2007, 06:49:17 pm
Just to clarify - if I am looking for the most stable version of GCC 4.2 - which one should I grab at this point?
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: patlecat on June 28, 2007, 06:56:54 pm
ok I reinstalled the not-working version for you. And this is the output from DialogBlock:

Code
----------------------- Configuration: MinGW Release -----------------------
In directory: H:\myProjects2\MarkThyBooks
mingw32-make.exe -f makefile.gcc CONFIG=release clean all
if exist MinGWRelease\*.o del MinGWRelease\*.o
if exist MinGWRelease\*.res del MinGWRelease\*.res
if exist MinGWRelease\MarkThyBooks.exe del MinGWRelease\MarkThyBooks.exe
g++.exe -c -o MinGWRelease/markthybooksapp.o -fno-rtti -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -DUNICODE   -O -Wall -I"H:/wxWidgets-2.8.4/include" -I"H:/wxWidgets-2.8.4/contrib/include" -I"H:/wxWidgets-2.8.4/lib/gcc_lib/mswu" markthybooksapp.cpp
*** In file included from H:/wxWidgets-2.8.4/include/wx/memory.h:16,
***                  from H:/wxWidgets-2.8.4/include/wx/object.h:20,
***                  from H:/wxWidgets-2.8.4/include/wx/wx.h:16,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/string.h:176:18: error: string: No such file or directory
*** In file included from H:/wxWidgets-2.8.4/include/wx/memory.h:16,
***                  from H:/wxWidgets-2.8.4/include/wx/object.h:20,
***                  from H:/wxWidgets-2.8.4/include/wx/wx.h:16,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/string.h:181: error: 'wstring' in namespace 'std' does not name a type
*** H:/wxWidgets-2.8.4/include/wx/string.h:714: error: expected ',' or '...' before '&' token
*** H:/wxWidgets-2.8.4/include/wx/string.h:714: error: ISO C++ forbids declaration of 'wxStdString' with no type
*** H:/wxWidgets-2.8.4/include/wx/string.h:714: error: 'wxString::wxString(int)' cannot be overloaded
*** H:/wxWidgets-2.8.4/include/wx/string.h:682: error: with 'wxString::wxString(int)'
*** H:/wxWidgets-2.8.4/include/wx/string.h: In constructor 'wxString::wxString(int)':
*** H:/wxWidgets-2.8.4/include/wx/string.h:715: error: 's' was not declared in this scope
*** In file included from H:/wxWidgets-2.8.4/include/wx/wx.h:21,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/hashmap.h: In member function 'wxLongToLongHashMap_wxImplementation_HashTable::Node** wxLongToLongHashMap_wxImplementation_HashTable::GetNodePtr(const long int&) const':
*** H:/wxWidgets-2.8.4/include/wx/hashmap.h:714: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** In file included from H:/wxWidgets-2.8.4/include/wx/event.h:18,
***                  from H:/wxWidgets-2.8.4/include/wx/wx.h:25,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h: In member function 'wxShadowObjectMethods_wxImplementation_HashTable::Node** wxShadowObjectMethods_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h:20: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h: In member function 'wxShadowObjectFields_wxImplementation_HashTable::Node** wxShadowObjectFields_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
*** H:/wxWidgets-2.8.4/include/wx/clntdata.h:25: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** In file included from H:/wxWidgets-2.8.4/include/wx/event.h:21,
***                  from H:/wxWidgets-2.8.4/include/wx/wx.h:25,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/gdicmn.h: In member function 'wxStringToColourHashMap_wxImplementation_HashTable::Node** wxStringToColourHashMap_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
*** H:/wxWidgets-2.8.4/include/wx/gdicmn.h:544: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** In file included from H:/wxWidgets-2.8.4/include/wx/wx.h:45,
***                  from markthybooksapp.cpp:24:
*** H:/wxWidgets-2.8.4/include/wx/image.h: In member function 'wxImageHistogramBase_wxImplementation_HashTable::Node** wxImageHistogramBase_wxImplementation_HashTable::GetNodePtr(const long unsigned int&) const':
*** H:/wxWidgets-2.8.4/include/wx/image.h:136: warning: dereferencing type-punned pointer will break strict-aliasing rules
*** mingw32-make.exe: *** [MinGWRelease/markthybooksapp.o] Error 1
Done.

8 errors, 5 warnings
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on June 28, 2007, 07:50:36 pm
dwmcqueen:
As far as I'm concerned, the most recent version I posted (gcc-4.2.0-tdm-2.7z) is as stable as the first. I applied no additional patches to the GCC source (or performed any other chages); the only difference between the first release and the second was some different command-line parameters during the build, to create (hopefully) faster compiler executables. So I would say you should use the second release (gcc-4.2.0-tdm-2.7z). Additionally...

patlecat:
I'm unable to reproduce the problem, and have never encountered a similar one. I recommend you check your Windows environment variables to make sure that no strange GCC-related ones are messing things up -- all you should have is "H:\MinGW\bin" (or wherever you chose to put it) in your PATH variable -- and completely clean out your MinGW directory, reinstalling from scratch. As always, install my GCC 4.2.0 package last and overwrite any duplicated files.

In case you're interested, here is the source I used to try to duplicate it:
Code
#include <wx/wx.h>

int main()
{
return 0;
}
... and here is the command line:
Code
g++.exe -c -o test.o -fno-rtti -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -DUNICODE -O -Wall -I"G:\Libraries\wxMSW-2.8.4\include" -I"G:\Libraries\wxMSW-2.8.4\lib\gcc_dll\mswu" test.cpp

Cheers,
John E. / TDM
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: eloj on June 29, 2007, 03:10:50 pm
Something definitely changed with tdm-2, because when I put it over my tdm-1 installation I too started getting missing includes when compiling from another drive:

Code
C:\>cat dummy.c
#include <stdlib.h>

int main(int argc, char* argv[])
{
  char* c = malloc(10);
  free(c);
}

C:\>gcc dummy.c

C:\>copy dummy.c h:\dev\WORK
        1 file(s) copied.

C:\>h:

H:\dev\WORK>gcc dummy.c
dummy.c:1:20: error: stdlib.h: No such file or directory
dummy.c: In function 'main':
dummy.c:5: warning: incompatible implicit declaration of built-in function 'malloc'

edit: The above is a cc1.exe issue, because if I install TDM-2 and replace the cc1.exe with the one from TDM-1, it works again.

I should also say that with TDM-1 I was getting some annoying message box sometime since cc1.exe or the driver tried to access a volume (my CDROM) which had no disc. Cancelling the msgbox would allow the compilation to continue, but in the end I simply put a CD or DVD in to get rid of it. Never really tried to debug the issue. I assume this has to do with the "relocatable installation directory" modifications.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: Zoinky on June 30, 2007, 03:50:47 pm
patlecat:
I'm unable to reproduce the problem, and have never encountered a similar one. I recommend you check your Windows environment variables to make sure that no strange GCC-related ones are messing things up -- all you should have is "H:\MinGW\bin" (or wherever you chose to put it) in your PATH variable -- and completely clean out your MinGW directory, reinstalling from scratch. As always, install my GCC 4.2.0 package last and overwrite any duplicated files.

In case you're interested, here is the source I used to try to duplicate it:
Code
#include <wx/wx.h>

int main()
{
return 0;
}
... and here is the command line:
Code
g++.exe -c -o test.o -fno-rtti -fno-pcc-struct-return -fstrict-aliasing -Wall -D__WXMSW__ -D__GNUWIN32__ -D__WIN95__ -DUNICODE -O -Wall -I"G:\Libraries\wxMSW-2.8.4\include" -I"G:\Libraries\wxMSW-2.8.4\lib\gcc_dll\mswu" test.cpp

Cheers,
John E. / TDM

I receive similar errors when using gcc 4.2.0 (thanks for providing it, by the way) to build wxWidgets 2.8.4, and I'm wondering if it's because of the include directories that it's looking in (since it can't find <string>):

Code
C:\MinGW\libexec\gcc\mingw32\4.2.0>cc1plus -v
ignoring nonexistent directory "i:/MinGW/include/c++/4.2.0"
ignoring nonexistent directory "i:/MinGW/include/c++/4.2.0/mingw32"
ignoring nonexistent directory "i:/MinGW/include/c++/4.2.0/backward"
ignoring nonexistent directory "i:/MinGW/include"
ignoring nonexistent directory "i:/MinGW/lib/gcc/mingw32/4.2.0/include"
ignoring nonexistent directory "i:/MinGW/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
 /mingw/include
 /mingw/include
End of search list.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: nenin on June 30, 2007, 05:58:33 pm
Problems with cc1.exe and cc1plus.exe from tdm-2 confirmed. They can not find standard "include" path.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: eloj on June 30, 2007, 06:02:03 pm
Here's the difference in plain text, tdm-1 first, tdm-2 second:

Code
C:\MinGW\libexec\gcc\mingw32\4.2.0>cc1.exe -v
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/include"
ignoring nonexistent directory "/extra/crossgcc/win-gcc/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
 /mingw/include
End of search list.
C:\MinGW\libexec\gcc\mingw32\4.2.0>cc1.exe -v
ignoring nonexistent directory "i:/MinGW/include"
ignoring nonexistent directory "i:/MinGW/lib/gcc/mingw32/4.2.0/include"
ignoring nonexistent directory "i:/MinGW/mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
 /mingw/include
 /mingw/include
End of search list.

Since I have my installation in c:/mingw anyhow, I simply hex-edited cc1.exe and cc1plus.exe and changed "i:/MinGW" to "c:/MinGW", which seems to have solved the problem. I guess a "subst I: C:\" would work too, if you don't mind the extra mapping and if I: is available.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: nenin on June 30, 2007, 06:47:34 pm
eloj, it work. I also have mingw in c:/mingw, and correction of cc1 and cc1plus resolve problem, at least on simple project.  :D
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on July 01, 2007, 12:41:46 am
There are some strange things going on here -- fortunately, I'm now able to reproduce the problem. One note before I start looking for a good solution: the "nonexistent directory" messages are to be expected, because GCC is running on a system other than the one it was compiled on. Unfortunately the "-v" option doesn't show what's happening during the relative-to-self search which, for Windows systems, is supposed to (and usually does) turn up the correct location to find the file. I can speculate that the problem is directly tied to a lack of awareness of Windows' "current volume" concept.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: dwmcqueen on July 03, 2007, 04:28:46 am
Well, it also fails if you don't use MinGW as your directory.  I needed to revert to the earlier one, since I use C:\MinGW-4.2
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: dwmcqueen on July 03, 2007, 06:14:46 pm
That is true.  Two seconds to rename, two seconds to rename back, and so on.  However, if the compiler needs to be in non-standard I:\MingW then that is okay.  Really no reason for me to have that old compiler on there anyways - is there?

Why are we on a death wish wanting to use our own folder names for the compiler??  That I do not understand.

I think the problem is the earlier release did not have this issue, and could be located wherever.  People get used to things when they work, and then don't like them when something changes that changes the whole schematic. 

TD has done wonderful work.  I just didn't expect to have to install his package in one location and one location only.
Title: Re: Unofficial GCC 4.2.0 for MinGW available
Post by: TDragon on July 03, 2007, 07:41:05 pm
I think the problem is the earlier release did not have this issue, and could be located wherever.  People get used to things when they work, and then don't like them when something changes that changes the whole schematic. 

TD has done wonderful work.  I just didn't expect to have to install his package in one location and one location only.
That is in fact one of my primary goals when creating these releases: to achieve the same amount of flexibility of location as the official MinGW packages. As far as I'm concerned, you should be able to install it in C:\MinGW or Q:\ZarkingFrood as you please. :)

So I've been digging to find out how exactly this is accomplished. My 4.1.2 builds all succeed in this, but only the first 4.2.0 build did, and it was crossed-native-compiled from Ubuntu Linux. So I'm going to go ahead and create a third and hopefully final 4.2.0 release, which will include the same optimizations I used for the second, but will be cross-native-compiled as the first one.

Keep your eyes peeled for it!
-John E. / TDM

Edit:
It's now here -- gcc-4.2.0-tdm-3: optimized but fully relocatable; install wherever you like! There should also be no more unnecessary accesses of your CD drives, etc. I have also made a build supporting OpenMP parallelization through the "-fopenmp" option.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: madd on July 04, 2007, 04:51:01 pm
Is support for 64 bit included in these binaries?

Also it seems to use STL from v3.4.5.   
I.e. if I rename includes/c++/3.4.5 to something else it wont compile programs that use STL, unless I manually add 4.2.0 to the include dirs..

Am I the only one with this problem?
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: nenin on July 04, 2007, 05:16:48 pm
Now looks like OK!
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: TDragon on July 04, 2007, 08:27:02 pm
madd:
Nope, sorry. I'm not sure what the state of 64-bit support in MinGW is at the moment, actually. *Makes a mental note to look at the recent win64 releases*
For the problem with using the wrong STL: it seems like an older driver or other older file is being used incorrectly. You should probably try reinstalling from a "clean slate" -- i.e. install all your desired MinGW packages (except gcc-core and gcc-g++), and then install mine.

20-40:
It's hard to answer everything you've brought up (in fact it's hard to read and understand most of your posts in the first place), but in a general way I disagree with you. I do not provide a "crippled" compiler, nor am I aware that I have in any way "nullified" any "configure procedures" that would otherwise have worked with a distribution of GCC which used hard-coded paths for a single installation directory. One of my foremost aims as a software engineer is to provide software that "just works" -- so, if you can show me how the software I distribute fails to "just work" for a common scenario, I will try my hardest to correct it. Finally, I believe it's safe to say that in fact this is a compiler which needs nothing more than its "bin" directory in Windows' PATH.

Cheers,
John E. / TDM
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: dwmcqueen on July 04, 2007, 08:33:38 pm
Well, thanks again!

BTW, what bugs have you encountered with latest WinAPI and binutils?
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: TDragon on July 04, 2007, 08:39:53 pm
For kicks and giggles, and so everyone can see that flexibility of GCC's installation isn't a pie-in-the-sky dream, I installed MinGW's packages and mine in "C:\MinGW GCC in a path\with spaces", made sure that the only MinGW-related environment variable was "C:\MinGW GCC in a path\with spaces\bin" tacked onto the end of PATH, made sure that no directories named "mingw" or "MinGW" existed anywhere (or any of the directory names used when compiling on Ubuntu), and built wxWidgets 2.8.4 and Code::Blocks, both on drive G:\, completely without a hitch. That's what I call freedom, folks.

BTW, what bugs have you encountered with latest WinAPI and binutils?
The latest binutils' "windres" has a bug that shows up while building wxWidgets; it was mentioned on a MinGW mailing list and Danny Smith (I believe) had a fix for it that should appear in the next MinGW binutils release.

As far as the latest w32api package goes, I don't remember for sure when and how I encountered the bug, though I think it, also, occured while using or building wxWidgets. Since you asked, I'll see if I can track it down again.

Later edit:
I didn't encounter any bugs building with the latest version, so it may have been a bug in 3.8 that got ironed out in 3.9. I'll have to update my docs. Thanks for reminding me.

Cheers,
John E. / TDM
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: blahhh on July 05, 2007, 04:32:28 pm
TDM. The sources for GCC 4.2.0 are patched according to your site:
http://www.tdragon.net/recentgcc/

Why and what did you patch? The GCC 4.2 release compiles out of the box when I download it from gcc.gnu.org. I'm building a mingw compiler using a cygwin environment (hence it's not a cross compiler or something, I just like cygwin's environment more than msys).
I'm wandering what you are patching and also why it takes so long for MinGW to release an official Gcc 4 cause I see no bugs at all.

Thnx, blahhh
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: stahta01 on July 05, 2007, 04:44:11 pm
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
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: madd on July 05, 2007, 06:04:18 pm
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?
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: TDragon on July 05, 2007, 08:08:06 pm
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.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: madd on July 05, 2007, 08:42:42 pm
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.





Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: blahhh on July 05, 2007, 09:03:25 pm
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.

Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: TDragon on July 05, 2007, 09:04:58 pm
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.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: blahhh on July 05, 2007, 09:06:27 pm
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.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: TDragon on July 05, 2007, 09:11:26 pm
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.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: nenin on July 06, 2007, 05:31:25 pm
I read somewhere  in gcc roadmap that since 4.3. mingw will be included as officially supported platform. 
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: TDragon on July 06, 2007, 07:11:19 pm
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
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: TDragon on July 09, 2007, 08:58:27 pm
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.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: stahta01 on July 09, 2007, 09:01:05 pm
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
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: roland on July 09, 2007, 09:46:49 pm
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\
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: TDragon on July 09, 2007, 10:05:58 pm
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.)
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW available (now supporting OpenMP)
Post by: roland on July 09, 2007, 10:13:18 pm
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
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on July 09, 2007, 10:17:04 pm
Oops...make that " 2>errorlog.txt". Sorry.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: roland on July 09, 2007, 10:29:51 pm
Huge apologies for bug spam. I will start another topic if it is appropriate

" 2>errorlog.txt" creates a log file too big to post :P Nearly 500KB

here are are a few hundred lines starting from the beginning, should hopefully give you an idea...

[attachment deleted by admin]
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on July 09, 2007, 10:42:25 pm
Try adding another environment variable: "C_INCLUDE_PATH=C:\MinGW\lib\gcc\mingw32\4.2.0\include".
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: roland on July 09, 2007, 10:57:36 pm
Thanks. With that, I get a little further... some errors pop up a few minutes into the compile...


[attachment deleted by admin]
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on July 09, 2007, 11:13:35 pm
I should've seen that coming. New variable CPLUS_INCLUDE_PATH, same value as C_INCLUDE_PATH. (In case you're interested, I'm getting these from http://gcc.gnu.org/onlinedocs/gcc-4.2.0/gcc/Environment-Variables.html.)


Also, here's a little experiment I thought up that will help me understand a bit better how GCC is working under Vista. If you could try it out and post your results, I'd appreciate it.

1. Remove all GCC/MinGW related environment variables, including any PATH entries.

2. Rename the base folder of your current MinGW installation to something like "testmingw". The idea is to make sure "\MinGW" doesn't exist.

3. Create a new text file called "gcc.bat" which contains the following two lines:
     @ECHO OFF
     C:\testmingw\bin\gcc.exe %*
   where C:\testmingw corresponds to wherever your MinGW installation is.
   Save the file somewhere other than in your MinGW folder -- i.e. "C:\testbat\gcc.bat"

4. Add the location of gcc.bat to your PATH environment variable -- i.e. "<other stuff>;C:\testbat"

5. Create a simple test file called "test.cpp" somewhere with the following code:
Code
#include <cstdio>
#include <string>
int main()
{
    return 0;
}

6. Open up a command prompt and enter the following commands (assuming you saved test.cpp to C:\anothertestfolder):
Code
C:
cd \anothertestfolder
gcc -v -c test.cpp

Post the output (feel free to use the redirection trick to get something that's easier to copy'n'paste, but use 1> instead of 2> if you do).

Edit:
D'oh. <cstdio>, not <cstdio.h>...
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: roland on July 10, 2007, 12:34:55 am
I read, reread, triple-checked, and it does not seem to work.  :?

I then removed the environmental variable, renamed the folder to MinGW, opened the .cpp file in codeblocks and it compiles. Good thing codeblocks is smart enough to run without environmental variables ;) Now if I can only get other things to work... O__O
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on July 10, 2007, 12:50:08 am
I read, reread, triple-checked, and it does not seem to work.  :?
What do you mean by that? Which part doesn't work? What error message do you get?
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: roland on July 10, 2007, 01:00:13 am
What I mean is that it did nothing. It simply does not appear to detect gcc and returns the same error it would as if it did not exist at all:
Code
C:\>gcc -v -c testing.cpp 1> log.txt
'gcc' is not recognized as an internal or external command,
operable program or batch file.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on July 10, 2007, 01:05:05 am
Gotcha. And if you then enter:
Code
echo %PATH%
you get a list of paths that includes the location of gcc.bat?

(Note: Any time you change a Windows environment variable, you need to exit and reopen any command shells for the change to take effect.)
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: roland on July 10, 2007, 01:07:11 am
wait backup... silly me I should have followed your filenames exactly, I now see that "gcc.bat" is important :P I named it something else. okay, it works.

1> creates a blank text file

2> creates this:

Code
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++,fortran,objc,java --with-as=/extra/crossgcc/cross-gcc/bin/mingw32-as --with-ld=/extra/crossgcc/cross-gcc/bin/mingw32-ld --with-gcj=/extra/crossgcc/cross-gcc/bin/mingw32-gcj --disable-shared --with-gcc --with-gnu-as --with-gnu-ld --disable-debug --disable-nls --enable-threads=win32 --disable-win32-registry --enable-sjlj-exceptions --enable-fully-dynamic-string --disable-libstdcxx-pch --with-mtune=i686 --enable-libgomp --with-gmp=/extra/crossgcc/win-gmp-install --with-mpfr=/extra/crossgcc/win-mpfr-install --enable-libgcj --without-x --disable-java-awt
Thread model: win32
gcc version 4.2.0
 cc1plus -quiet -v -iprefix c:\testmingw\bin\../lib/gcc/mingw32/4.2.0/ testing.cpp -quiet -dumpbase testing.cpp -mtune=i386 -auxbase testing -version -o ./ccF2DNa1.s
gcc.exe: CreateProcess: No such file or directory

without using either 1> or 2>:
Code
C:\>gcc -v -c test.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++,fortran,objc,java --with-as=/extra/crossgcc/
cross-gcc/bin/mingw32-as --with-ld=/extra/crossgcc/cross-gcc/bin/mingw32-ld --with-gcj=/extra/crossg
cc/cross-gcc/bin/mingw32-gcj --disable-shared --with-gcc --with-gnu-as --with-gnu-ld --disable-debug
 --disable-nls --enable-threads=win32 --disable-win32-registry --enable-sjlj-exceptions --enable-ful
ly-dynamic-string --disable-libstdcxx-pch --with-mtune=i686 --enable-libgomp --with-gmp=/extra/cross
gcc/win-gmp-install --with-mpfr=/extra/crossgcc/win-mpfr-install --enable-libgcj --without-x --disab
le-java-awt
Thread model: win32
gcc version 4.2.0
 cc1plus -quiet -v -iprefix c:\testmingw\bin\../lib/gcc/mingw32/4.2.0/ test.cpp -quiet -dumpbase tes
t.cpp -mtune=i386 -auxbase test -version -o ./ccKV7mkz.s
gcc.exe: CreateProcess: No such file or directory

C:\>

and your following request...
Code
C:\>echo %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\QuickTime\QTSystem\;C:\Pyth
on25\;C:\testbat\
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on July 10, 2007, 01:23:29 am
Right, thanks.

The point of this exercise, I guess, is that it is possible to avoid "pollution" of Windows' main set of environment variables by performing some trickery with batch files. However, for most users it's probably not worth all the additional work it would be.

The quickest solution for you right now is to restore all your GCC-related environment variables:
PATH=<whatever>;C:\MinGW\bin;C:\MinGW\mingw32\bin;C:\MinGW\libexec\gcc\mingw32\4.2.0
C_INCLUDE_PATH=C:\MinGW\include;C:\MinGW\lib\gcc\mingw32\4.2.0\include
CPLUS_INCLUDE_PATH=C:\MinGW\include;C:\MinGW\lib\gcc\mingw32\4.2.0\include;C:\MinGW\include\c++\4.2.0;C:\MinGW\include\c++\4.2.0\mingw32
LIBRARY_PATH=C:\MinGW\lib;C:\MinGW\lib\gcc\mingw32\4.2.0

I think those should be all that's necessary for doing command-line compilations (like building wxWidgets...), but if there are any others that you've found necessary, add them by all means.

If you run across more errors, toss 'em out and we'll knock 'em down. Meanwhile I'll try to sweet-talk someone into buying me a copy of Windows Vista.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: roland on July 10, 2007, 01:49:17 am
Thanks! Compiling now. About 15mins in... so far so good... will edit with results.

I have successfully compiled a monolithic dll and then compiled a sample wxwidgets program in codeblocks. Thanks!
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: eloj on July 13, 2007, 11:58:29 pm
Will you do a 4.2.1? Looks like it'll be out of RC2 in about a week. I don't know if there are any relevant bug-fixes though.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on July 14, 2007, 12:06:47 am
Will you do a 4.2.1? Looks like it'll be out of RC2 in about a week. I don't know if there are any relevant bug-fixes though.
As soon as it's released, definitely. There have been a few bug fixes, but the one I've been hoping would be fixed hasn't yet. There's still time, however, as it was mentioned in the most recent status report that the fix could make it in for an RC3.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: dwmcqueen on July 14, 2007, 11:25:44 pm
Something I noticed - and am having a weird time figuring out how.

I have this version installed to C:\MingW-4.2\.  However, the linker is pulling in libraries from my C:\MingW\lib directory even though it is not specified as a library path (and isn't in an environment variable).  It also pulls in from my C:\MingW-4.2\lib.  Anyone know how to get it to ignore my C:\MingW\lib directory?
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: stahta01 on July 14, 2007, 11:35:48 pm
Something I noticed - and am having a weird time figuring out how.

I have this version installed to C:\MingW-4.2\.  However, the linker is pulling in libraries from my C:\MingW\lib directory even though it is not specified as a library path (and isn't in an environment variable).  It also pulls in from my C:\MingW-4.2\lib.  Anyone know how to get it to ignore my C:\MingW\lib directory?

I have found that in order to avoid that you can not have an X:\MingW on your computer (where X is any of the drives on your computer).

Tim S
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on July 14, 2007, 11:51:56 pm
What Tim said. :)

Basically, "/mingw/lib" is, by default, hardcoded into the directories to be searched. If someone more knowledgeable about GCC's internal workings than me provides a patch to turn this off, I can certainly apply it to my distributions.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: dwmcqueen on July 15, 2007, 01:23:02 am
Does it search there before or after the one passed in (in my case C:\MingW-4.2)?
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: dwmcqueen on July 15, 2007, 08:24:16 pm
I just wanted to make sure I understood what you said, 20-40 - are you saying we are insane to name our directories C:\MingW-[version] or one would be insane to install it to C:\MingW ?
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: stahta01 on July 15, 2007, 08:30:06 pm
I just wanted to make sure I understood what you said, 20-40 - are you saying we are insane to name our directories C:\MingW-[version] or one would be insane to install it to C:\MingW ?

I myself consider it best to only install to C:\MinGW or in using multiple installs to make sure C:\MinGW does not exists.

Note: Per my understanding of TDM Directions, when building GCC you should use C:\MinGW. Since I don't use C:\MinGW I think I know why my last try on building MinGW GCC failed. ( About 2 to 3 months ago.)

Tim S
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: stahta01 on July 15, 2007, 08:57:18 pm
FYI:

I finally found the option to remove some warnings on compiling Code::Blocks.

warning: deprecated conversion from string constant
-Wno-write-strings

Edit: Sorry if this was already mentioned, the CB search did not find it, but CB search misses a lot of things.

Tim S
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: dwmcqueen on July 15, 2007, 09:14:45 pm
Just checking - hard to tell when you are being sarcastic or straightforward
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: dwmcqueen on July 16, 2007, 02:14:32 am
But you have done much for the GCC compiler under MingW - and for that I appreciate your work!
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: jsibarani on July 16, 2007, 02:29:27 pm
Thanks!

I have successfully compiled a monolithic dll and then compiled wxAui  sample

Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: marouanebj on September 17, 2007, 09:24:56 pm
Hi,
I don't know if it's the proper place.
But I have a probleme compiling a program with OpenMP.
1/ I installed the last release of MinGW with the installer 5.1.3
2/ I dowloaded the GCC 4.2.1 TDM 2 from http://www.tdragon.net/recentgcc/
3/ I putted them in C/MinGW
I use Eclipse to compile
this is the progam:
// ================================
// Hello World OpenMP
// program that write Hello word for each thread
// ================================
#include <omp.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
   int nthreads, tid;
   /* Fork a team of threads giving them their own copies of variables */
   #pragma omp parallel private(tid)
   {
      /* Obtain and print thread id */
      //tid = omp_get_thread_num();
      tid = 0;
      printf("Hello World from thread = %d\n", tid);
   
      /* Only master thread does this */
      if (tid == 0) {
         //nthreads = omp_get_num_threads();
         nthreads = 1;
         printf("Number of threads = %d\n", nthreads);
      }   
   }  /* All threads join master thread and terminate */
   return 0;
}
// =================
This is the console msg:
**** Build of configuration Release for project test gcc ****

**** Internal Builder is used for build               ****
gcc -O3 -g -Wall -c -fmessage-length=0 -fopenmp -osrc\main.o ..\src\main.c
gcc -otestgcc.exe src\main.o
src\main.o: In function `main':C:/Documents and Settings/marouane/eclipse_workspace/test gcc/Release/../src/main.c:9: undefined reference to `GOMP_parallel_start'
:C:/Documents and Settings/marouane/eclipse_workspace/test gcc/Release/../src/main.c:9: undefined reference to `GOMP_parallel_end'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 1063  ms.


can someone help me.
Thanks
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: stahta01 on September 17, 2007, 10:28:14 pm
Hi,
I don't know if it's the proper place.
But I have a probleme compiling a program with OpenMP.
1/ I installed the last release of MinGW with the installer 5.1.3

I suggest doing a manual install so you know exactly what binaries were installed.

Tim S
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: TDragon on September 18, 2007, 04:11:07 am
marouanebj:
You need to add "-fopenmp" to the linking step as well. I'm not sure how this is done in Eclipse.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: marouanebj on September 18, 2007, 10:33:23 am
Hi again, Still same troubles

ok I added the -fopenmp in the linking. Here is the result:
**** Internal Builder is used for build               ****
gcc -O3 -g -Wall -c -fmessage-length=0 -fopenmp -osrc\main.o ..\src\main.c
gcc -Xlinker -fopenmp -shared -olibtestgcc.exe src\main.o
src\main.o: In function `main':C:/Documents and Settings/marouane/eclipse_workspace/test gcc/Release/../src/main.c:9: undefined reference to `GOMP_parallel_start'
:C:/Documents and Settings/marouane/eclipse_workspace/test gcc/Release/../src/main.c:9: undefined reference to `GOMP_parallel_end'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 328  ms.


Is it possible that I have a Path Problem ? or the information on where is the lib which contain this header (omp.h)  file.
- I'm almost a beginner in compiling, so if I say strange things correct me.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: marouanebj on September 18, 2007, 10:36:44 am
should I add the -fopenmp in the GCC Assembler flags ?
information: the configuration on Eclipse are divided in 3: Assembler, Compiler, Linker.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: marouanebj on September 18, 2007, 11:37:18 am
OK I got it.

There was an error in the second compilation:
this work:
**** Internal Builder is used for build               ****
gcc -O2 -g -Wall -c -fmessage-length=0 -fopenmp -osrc\main.o ..\src\main.c
gcc -fopenmp -otestgcc.exe src\main.o
Build complete for project test gcc
Time consumed: 281  ms. 

Thanks All
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: asdz on November 21, 2007, 09:27:59 pm
I am using NetBeans 6.0 on Windows XP...
I have add with success the GCC 4.2 build for Windows....
But i can't still now to compile a simple OpenMP code...
I have added -fopenmp compile option but still nothing...

Any advice? :S
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: Grom on November 21, 2007, 10:05:36 pm
see OpenMP tutorial. You have to make your's program parallel manually with something like that #pragma omp parallel for.
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: asdz on November 22, 2007, 09:14:22 am
I am already running the simple Hello World - OpenMP code in NetBeans where i have these problems...
The same code is compiled fine on my machine in visual Studio 2005.... That's why i want some help with NetBeans 6.0 - OpenMP...
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: asdz on December 02, 2007, 11:15:57 pm
I am already running the simple Hello World - OpenMP code in NetBeans where i have these problems...
The same code is compiled fine on my machine in visual Studio 2005.... That's why i want some help with NetBeans 6.0 - OpenMP...
anyone?
Title: Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
Post by: JacK-DuRdEn_ on December 19, 2007, 09:40:02 pm
hi i was having problems with netbeans too, but i finally worked it out.
i had to modify the file libgomp.spec in the lib directory so it looks like this:

Code
# This spec file is read by gcc when linking.  It is used to specify the
# standard libraries we need in order to link

with -fopenmp.
*link_gomp: -lgomp -lpthread

then i modified the file Makefile-Debug.mk (you should also modify Makefile-Release.mk if using that target; this file are
located in your project's "nbproject" directory)
adding "-fopenmp" (without quotes) to the CCFLAGS, CXXFLAGS, CFLAGS and LDLIBSOPTIONS lines. Maybe not
all of them are necessary but it works and it doesn't hurts xD you could figure out which one's are useless anyway.

sorry for posting info about other ide >_<