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

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #15 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.
« Last Edit: May 20, 2007, 12:02:36 am by patlecat »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #16 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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #17 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #18 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


« Last Edit: May 20, 2007, 02:36:48 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline heromyth

  • Multiple posting newcomer
  • *
  • Posts: 98
    • http://
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #19 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 :(.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #20 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 . . .
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline snija

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #21 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

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #22 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.
« Last Edit: May 20, 2007, 06:06:18 am 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)

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #23 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 . . .
« Last Edit: May 20, 2007, 10:52:50 am by patlecat »

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #24 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?
« Last Edit: May 20, 2007, 10:22:53 am by patlecat »

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #25 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.
« Last Edit: May 20, 2007, 11:14:05 am by patlecat »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #26 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
Be a part of the solution, not a part of the problem.

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #27 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.

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #28 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.
Be a part of the solution, not a part of the problem.

Offline patlecat

  • Multiple posting newcomer
  • *
  • Posts: 62
Re: Unofficial GCC 4.2.0 for MinGW available
« Reply #29 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