Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » External resources » MingW/GCC 4.1
MingW/GCC 4.1 [message #6325] Mon, 06 November 2006 15:18 Go to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I have came across this interesting link:

http://www.aristeia.com/Misc/gcc4ForWindows_frames.html

Perhaps somebody could give it a try...

Mirek
Re: MingW/GCC 4.1 [message #6345 is a reply to message #6325] Tue, 07 November 2006 15:09 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
I have done it and it works Very Happy .
Compilation is a bit faster, but not significantly faster.
The resulting exe is about 10% bigger.

Matthias
Re: MingW/GCC 4.1 [message #6356 is a reply to message #6345] Thu, 09 November 2006 10:49 Go to previous messageGo to next message
gprentice is currently offline  gprentice
Messages: 260
Registered: November 2005
Location: New Zealand
Experienced Member
masu wrote on Wed, 08 November 2006 03:09


The resulting exe is about 10% bigger.




10% bigger. Are you sure? I wonder what could be the reason.

Graeme
Re: MingW/GCC 4.1 [message #6357 is a reply to message #6356] Thu, 09 November 2006 10:58 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
I cannot tell you the reason, but I built theide with exactly the same settings.
The exe size with mingw 3 was about 4.7MB and with version 4 it is 5.1MB.

Matthias
Re: MingW/GCC 4.1 [message #6686 is a reply to message #6345] Wed, 22 November 2006 22:26 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
masu wrote on Tue, 07 November 2006 15:09

I have done it and it works Very Happy .



I've tried to build the ggc4 as suggested but I failed in the last but one step, successfully calling:

make CFLAGS="-O2 -fomit-frame-pointer" CXXFLAGS="-mthreads -fno-omit-frame-pointer -O2" LDFLAGS=-s bootstrap2"

Whatever I do I get the following error message:

...
xgcc.exe: _spawnv: No such file or directory
make[3]: *** [libgcc/./_chkstk.o] Error 1
make[3]: Leaving directory `/gcc4-work/build/gcc4/gcc'
make[2]: *** [libgcc.a] Error 2
make[2]: Leaving directory `/gcc4-work/build/gcc4/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/gcc4-work/build/gcc4/gcc'
make: *** [bootstrap2] Error 2

As I'm not experienced in a Unix/Linux environment, might I ask you for a hint?

Thanks in advance.

Werner
Re: MingW/GCC 4.1 [message #6694 is a reply to message #6686] Thu, 23 November 2006 14:44 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
For my first build I adaopted the process a bit to my needs, since I already had mingw and msys installed.
But I tried it once more on another "clean" system by following exactly the instructions on the website and it worked.
I only build gcc and installed binary versions of all other packages.
Have you deleted m4.exe in c:\gcc\bin before building?
Did you have a clean system (did the build process really use the binaries you installed during the preperation steps)?

Matthias
Re: MingW/GCC 4.1 [message #6700 is a reply to message #6694] Thu, 23 November 2006 18:54 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
I finally managed to build gcc4.

The problem was caused by the paragraph in Scott Meyers' article "Building gcc 4 for Windows 2000" (http://www.aristeia.com/Misc/gcc4ForWindows_frames.html) where he suggests to use the Unix sh command "PATH=...".

I find this paragraph strongly misleading if not simply wrong:

The path is already set by changing the environment variable as Marcelo Slomp suggests in his original article, immediately before the paragraph in question. So the Unix sh command is not necessary and in fact - at least on my system - caused some strange effects and finally foiled the build process.

So the simple solution is: Do as Slomp and Meyers suggest but do not modify the path in the mingw window. Instead set the path under Windows as Slomp suggests and afterwards change it to "[drive]:\msys\mingw\bin".

Werner
Re: MingW/GCC 4.1 [message #6701 is a reply to message #6694] Thu, 23 November 2006 18:59 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
masu wrote on Thu, 23 November 2006 14:44

Did you have a clean system (did the build process really use the binaries you installed during the preperation steps)?



Thank you for your help! Please see my message #6700.

Werner
Re: MingW/GCC 4.1 [message #6702 is a reply to message #6700] Thu, 23 November 2006 19:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Great. Now do not forget build the ide to check the size...Smile

(Actually, at this moment I hope it will be as Matthias said - too much work to upgrade GCC environment now Wink

Mirek
Re: MingW/GCC 4.1 [message #6703 is a reply to message #6700] Thu, 23 November 2006 19:10 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
You are right, the instruction of setting the PATH via shell is wrong, it has to be either

# PATH=c:\\gcc\\bin:$PATH


or

# PATH=/c/gcc/bin:$PATH


I used the second alternative. And this makes sure that the compiler at location c:\gcc\bin is used and no other.
If you modify the PATH variable under Windows, it is possible that you use a different compiler without knowing it, because PATH of the already installed compiler stands before your PATH definition.

Matthias
Re: MingW/GCC 4.1 [message #6705 is a reply to message #6702] Thu, 23 November 2006 21:52 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
luzr wrote on Thu, 23 November 2006 19:00

Great. Now do not forget build the ide to check the size...Smile

(Actually, at this moment I hope it will be as Matthias said - too much work to upgrade GCC environment now Wink
Mirek



Sorry: not possible at the moment!

While MSC8 works fine, gcc4 returns:

Quote:

DrawTextWin32.cpp
D:\ProgWin\upp\uppsrc\Draw\DrawTextWin32.cpp: In static member function 'static void Draw::InitPlatformFonts()':
D:\ProgWin\upp\uppsrc\Draw\DrawTextWin32.cpp:163: error: call of overloaded 'abs(LONG&)' is ambiguous
C:/msys/mingw/include/stdlib.h:367: note: candidates are: int abs(int)
D:/ProgWin/upp/uppsrc/Core/Defs.h:207: note: int64 abs(int64)



Werner
Re: MingW/GCC 4.1 [message #6706 is a reply to message #6705] Thu, 23 November 2006 21:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes. Cast that LONG to (int) please.

Sorry. Sometimes happens in "dev" releases, Daniel not always has time to check with mingw...

Mirek
Re: MingW/GCC 4.1 [message #6707 is a reply to message #6706] Thu, 23 November 2006 22:47 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
luzr wrote on Thu, 23 November 2006 21:59

Yes. Cast that LONG to (int) please.

Sorry. Sometimes happens in "dev" releases, Daniel not always has time to check with mingw...



Unfortunately still no chance:

1.
CtrlCore\Win32ImgClip.cpp - line 28 - needs the same cast: (int).

2.
A couple of warnings as:
enumeral mismatch; no newline at end of file.

3.
But then ... (I just copied crt... - not knowing better):
Linking...
c:/msys/mingw/bin/../lib/gcc/mingw32/4.1.1/crtbegin.o:crtstu ff.c:(.text+0x5): undefined reference to `__w32_sharedptr_initialize'
collect2: ld returned 1 exit status

Werner
Re: MingW/GCC 4.1 [message #6735 is a reply to message #6325] Sat, 25 November 2006 13:49 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
I've stopped to further investigate gcc4.

The problems to be solved are to big (for me). Having available under Windows MSC8 and MinGW342 makes it appear disproportionate to strive to get gcc4 to work.

Even following Scott Meyers' article "Building gcc 4 for Windows 2000" (http://www.aristeia.com/Misc/gcc4ForWindows_frames.html) confronted me with a lot of problems:

1.
Scott Meyers' suggestion to set the path is wrong (refer to Matthias' message #6703). But for some unknown reason even Matthias' correction didn't work for me. So I had to stick to Marcelo Slomp's original suggestion to set the path under Windows. This seems to work. But it might even be possible that the problems as detailed below were caused by that approach.

2.
"tar jxf ..." didn't work for me. I could get round this problem by first using "bzip2 -d ..." and afterwards "tar xf ..." but nevertheless that seems to indicate a lurking problem.

3.
Although I finally managed to build gcc4, this process produced a lot of minor (?) error messages and warnings. I'm lacking ages of gcc and Unix experience as well as the time and the patience to handle all that. But it would have to be done because ...

4.
... the link process (of "TheIDE") fails. Obviously the linker is missing "crtbegin.o" and "crtend.o". Although the respective .asm files are in the gcc4 distribution the .o files don't show up after building gcc4. Copying them from older releases doesn't work.

If a Unix / gcc / minGW nerd would be willing to help, I'd give it another try - which probably would turn into quite a tedious chore.

Werner

[Updated on: Sat, 25 November 2006 13:51]

Report message to a moderator

Re: MingW/GCC 4.1 [message #7185 is a reply to message #6325] Mon, 18 December 2006 00:13 Go to previous messageGo to next message
Balage is currently offline  Balage
Messages: 17
Registered: December 2006
Promising Member
Why don't you just get it from here?
http://gcc.winports.org/

I compile all my apps with it. Optimizes very efficiently, especially if you turn on -march=athlon-xp or -march=pentium4 (I've tried it with some image processing code I wrote, way much better than 3.4).

You still need binutils, w32api, etc. from mingw site though.

And also, this version of GCC4 cannot find it's own includes (if installed somewhere else, than C:\MinGW), so you have to modify the INCLUDES in TheIDE (or whatever you use) to include these:

<GCC4>/include
<GCC4>/include/c++/4.1.1
<GCC4>/include/c++/4.1.1/mingw32

--
Greets,
B.
Re: MingW/GCC 4.1 [message #7191 is a reply to message #7185] Mon, 18 December 2006 08:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Balage wrote on Sun, 17 December 2006 18:13


I compile all my apps with it. Optimizes very efficiently,


Actually, based on Linux experience, it indeed looks like GCC4.1 is very pleasant surprise. I guess Apple is responsible Wink

Mirek
Re: MingW/GCC 4.1 [message #7197 is a reply to message #7185] Mon, 18 December 2006 10:43 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
Balage wrote on Mon, 18 December 2006 00:13

Why don't you just get it from here?
http://gcc.winports.org/



Thank you very much for this hint! I'll try it out as soon as possible.

Werner
Re: MingW/GCC 4.1 [message #7211 is a reply to message #7185] Mon, 18 December 2006 16:02 Go to previous messageGo to next message
Ulti is currently offline  Ulti
Messages: 108
Registered: September 2006
Experienced Member
Balage wrote on Sun, 17 December 2006 18:13

Why don't you just get it from here?
http://gcc.winports.org/


I can't reach the link,and I found another link:
http://gda.utp.edu.co/~ceniza/GCC-4.1.1/
BTW,how to make a new mingw with these GCC4s?
Re: MingW/GCC 4.1 [message #7216 is a reply to message #6325] Mon, 18 December 2006 18:13 Go to previous messageGo to next message
Balage is currently offline  Balage
Messages: 17
Registered: December 2006
Promising Member
The site I posted redirects here:
http://sourceforge.net/projects/winports

The simple way:
- install latest MinGW from mingw site
- overwrite all from the 4.1 archives

The harder way:
- get from mingw site:
* binutils
* mingw-runtime
* w32api
- unpack all to C:\MinGW, then unpack all from the 4.1 archives to the same place (overwriting if necessary)
Re: MingW/GCC 4.1 [message #7223 is a reply to message #7185] Mon, 18 December 2006 22:44 Go to previous messageGo to previous message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
Balage wrote on Mon, 18 December 2006 00:13

Why don't you just get it from here?
http://gcc.winports.org/

I compile all my apps with it. Optimizes very efficiently, especially if you turn on -march=athlon-xp or -march=pentium4 (I've tried it with some image processing code I wrote, way much better than 3.4).

You still need binutils, w32api, etc. from mingw site though.

And also, this version of GCC4 cannot find it's own includes (if installed somewhere else, than C:\MinGW), so you have to modify the INCLUDES in TheIDE (or whatever you use) to include these:

<GCC4>/include
<GCC4>/include/c++/4.1.1
<GCC4>/include/c++/4.1.1/mingw32

--
Greets,
B.


Works, but somewhat slow compared to MSC8:

Building "ide.exe" on an outdated Pentium 4, 2.66 GHz, with 1 GB RAM:

GCC 4.1.1 optimal: 16:52:39 min
MSC8 optimal: 9:39:37 min

Thanks again for the hint, Balage!

Werner
Previous Topic: Compiling a U++ Program with eclipse
Next Topic: Windows Installer XML (WiX) toolset
Goto Forum:
  


Current Time: Thu Mar 28 16:33:37 CET 2024

Total time taken to generate the page: 0.00872 seconds