User forums > General (but related to Code::Blocks)

GCC-4.4.0-MinGW Binary

<< < (2/5) > >>

Biplab:

--- Quote from: drac on April 28, 2009, 01:53:00 pm ---I have set C:\MinGW-4.4.0\bin\ the first (I did one test only with this directory) in path environment variable and
then I have ran Process Monitor to see what happens.

--- End quote ---

You should extract them to C:\MinGW folder. Otherwise it'd fail to execute other binaries.

Biplab:

--- Quote from: ollydbg on April 27, 2009, 09:35:09 am ---I found that there are several types of *unofficial mingw package"

http://www.equation.com/servlet/equation.cmd?call=fortran

and

http://www.tdragon.net/recentgcc/

I'm not sure what's the difference between them.
 :D

--- End quote ---

They differ by configuration options, way it's built, optimization options, platform naming scheme, etc.

drac:

--- Quote from: Biplab on April 28, 2009, 04:58:51 pm ---You should extract them to C:\MinGW folder. Otherwise it'd fail to execute other binaries.

--- End quote ---

Just tried it, the same behavior. Tested gcc and g++.

After some more digging I found out what was the problem.
The folder i686-pc-mingw32\bin\ had some very weird executables, containing only text like this (ar.exe):


--- Code: ---Link: bin/ar.exe
--- End code ---

The folder i686-pc-mingw32 was part of binutils-2.19.1-bin.tar.bz2 , after deleting it everything worked
fine (also in c:\mingw-4.4.0)

Cheers!

thomas:
Wish I was able to compile gcc... :(
How do you guys do this, it seems everybody and their grandmother can do it, only just not me...

Biplab:

--- Quote from: thomas on April 28, 2009, 09:43:04 pm ---Wish I was able to compile gcc... :(
How do you guys do this, it seems everybody and their grandmother can do it, only just not me...

--- End quote ---

May be I should write a blog post on how to compile this. For the time being, I'm explaining it in brief.

I prefer cross-compiling GCC as it's much faster (even from a VM) than CygWin or MSYS. Also my current antivirus freaks out every time I executes a script through MSYS.

1) You need a cross-compiler first. First install GMP-devel, MPFR-devel package on Linux. Then build BinUtils as-

--- Code: ---./configure --target=i686-pc-mingw32 --prefix=<BinUtils-Install-Dir> && make install
--- End code ---
Basically we need a binutils installation which can emit Windows executables on Linux.

2) Then extract mingw-runtime & runtime-devel, w32api packages to <BinUtils-Install-Dir>/i686-pc-mingw32 folder.

3) Add <BinUtils-Install-Dir> to path and configure & compile cross-gcc as-

--- Code: ---export PATH=<BinUtils-Install-Dir>/bin:$PATH
./configure --target=i686-pc-mingw32 --prefix=<BinUtils-Install-Dir> && make install
--- End code ---

4) Now build GMP and MPFR as -

--- Code: ---./configure --target=i686-pc-mingw32 --prefix=<BinUtils-Install-Dir> && make install
--- End code ---
This part you need to check the actual command to be used. Basic idea is to cross-compile them and install them to <BinUtils-Install-Dir> folder.

5) Now build GCC for MinGW as-

--- Code: ---./configure --host=i686-pc-mingw32 --target=i686-pc-mingw32 --prefix=/mingw && make
--- End code ---

Edit 1: You can get the extract newly compiled binary by issuing the following command.

--- Code: ---make DESTDIR=<compiled-mingw-dir> install
--- End code ---
<compiled-mingw-dir> can be any folder you want (e.g., /home/<Username>/foo). Only caveat is all your packages will be extracted to one folder. There should be a way to separate different language packages. But I don't know how to do that.

Hope this helps. :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version