# how to build GCC on windows



## deepbluegene (Jan 29, 2007)

hi

i am using cygwin and g++ version is 3.4.4.3 but i want to updrade it to 4.1.1
how i can do this.
before posting here i downloaded gcc4.1.1 from http://gcc.gnu.org/gcc-4.1/

and copied to local directory and directed cygwin to llok for files in that directory.it gave me option to upgrade to 4.1.1 from 3.4.4.3 but after running setup i checked the version and it was same old gcc. i ran setup again with same procedure and not there was no gcc/g++.

is there any guide to build gcc on cygwin or how to upgrade gcc on cygwin.

please help 
thanx


----------



## lotuseclat79 (Sep 12, 2003)

deepbluegene said:


> hi
> 
> i am using cygwin and g++ version is 3.4.4.3 but i want to updrade it to 4.1.1
> how i can do this.
> ...


Hi deepbluegene,

Welcome to TSG!

Gcc builds in a very standard way in all environments.

First, the setup, as you call it, consists of actually running the script named configure which adjusts the scripts to build gcc con your computer by detecting what libraries and header files are present. Note: you may have to set some environment variables.

Next, it is usually just a matter of running the command: make 
which should default to "make all". There may be an additional "make install" command necessary to install the build after it is compiled and linked without errors. Note: gcc is usually installed in /usr/bin directory (in Unix/Linux), but may be different in Cygwin.

Read the INSTALLATION file for information on building and installing the release. In the Cygwin environment, run the gcc info command: info gcc
in order to get more information.

-- Tom


----------



## deepbluegene (Jan 29, 2007)

thanx for reply.

the steps i am doing are

1. download gcc core.tar.bz2 and gcc-g++.tar.bz2.
2. create dir gcccompile
3. extract gcccore and gccg++ in gcccompile/gcc4/
4.after extraction there is directory gcc-4.1.1
5. change directory 'cd gcc-4.1.1'
6. run './configure'
7. 'make'
8. 'make install'

everything runs fine till the step 8 "make install"
at this step there is some error. i will run the whole procedure again will let you know about the error.

if i am doing anything wrong in the above steps please help me in right direction.

my frustration level is rising by minute that i can not even compile gcc. 

please help.
thanx


----------



## lotuseclat79 (Sep 12, 2003)

If no errors occurred with the "make" command, then you have completed the compilation. Waiting for your error log on "make install".

-- Tom


----------



## deepbluegene (Jan 29, 2007)

sorry for late reply but now i have dropped the idea of building gcc/g++ on cygwin for a while.currently i am using ubuntu and using gcc shipped with it. i was not comfortable with the command line options i have to give to build gcc because i did not knew what is the purpose of them.

now i am learning new things daily and hopefully within short time i will understand the complexity behind building from source and how to configure for one's requirement.

i will come back here if i face any problem.

thanx for your help.


----------



## lotuseclat79 (Sep 12, 2003)

Hi deepbluegene,

Its easy to configure gcc for your machine, just run the configure script via the command line: ./configure
Then run: make
and then run: make install
as you have already posted.

Do you mean to say you have unique requirements no one else has on your platform? What are they?

-- Tom


----------



## deepbluegene (Jan 29, 2007)

no i do not have unique requirements. i tried building other programs from source in ubuntu and they worked very well. only gcc in cygwin is giving problem.i do not know why. at this stage i do not need it. i am using it on ubuntu.

but thanx for your prompt reply.


----------



## Shadow2531 (Apr 30, 2001)

There's a mingw distro that uses GCC 4.1.2.
http://nuwen.net/mingw.html

It's not cygwin, but if you need a build environment that can ./configure stuff, you can use MSYS from mingw.org with it.

That distro of mingw comes with the boost library with its libs already built. It also comes with libsdl etc.


----------

