First tests with MinGW (gcc for Windows)

First tests with MinGW (gcc for Windows)

Postby Antonio Linares » Wed Sep 17, 2008 8:25 pm

We have started testing MinGW (GNU C compiler ported to Windows) and we have to say that the first tests are very promising :-)

You can download and install MinGW from here:
http://sourceforge.net/project/showfile ... _id=595197
Select the EXE setup.

Once installed on your computer, go to c:\MinGW\bin\

Create a file test.c with these contents:
test.c
Code: Select all  Expand view
#include <windows.h>

int WINAPI WinMain( HINSTANCE hInstance,   HINSTANCE hPrevInstance, LPSTR lpCmdLine,   int nCmdShow )
{
   MessageBox( 0, "Hello World", "From MingW", MB_ICONINFORMATION );
   
   return 0;
}

To build it, simply do:
gcc -otest.exe -mwindows test.c

Then you get test.exe, which it is a very small and self contained EXE. You can download the test.c file and the test.exe from here:
http://rapidshare.com/files/146133212/test.zip.html
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Wed Sep 17, 2008 8:49 pm

The make (EXE) file that we need to build Harbour and xHarbour can be downloaded from here:

http://sourceforge.net/project/showfile ... e_id=23918
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Wed Sep 17, 2008 10:02 pm

Building Harbour with MinGW:

Well, it worked ok on first try :-)

I created a makegnu.bat file with these contents:
Code: Select all  Expand view
set PATH=c:\MinGW\bin;%PATH%
echo mingw32-make.exe > make.bat
make_gnu.bat
del make.bat


Harbour.exe and libraries have been properly created. Next step, create a
EXE with Harbour and using its libraries :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Wed Sep 17, 2008 10:20 pm

A first EXE built with Harbour and MinGW has been a success :-)

I created a simple test.prg and a batch file to build it:
test.prg
Code: Select all  Expand view
function Main()

  Alert( "Hello world!" )

return nil

go.bat
Code: Select all  Expand view
c:\harbour\harbour\source\main\w32\mingw32\harbour.exe test.prg /n

c:\mingw\bin\gcc -c -otest.o -Ic:\harbour\harbour\include test.c

c:\mingw\bin\gcc test.o -otest.exe -Lc:\harbour\harbour\lib\w32\mingw32 -Wl,--start-group -lhbcommon -lhbvm -lhbrtl -lhbrdd -lhbmacro -lhblang -lhbcpage -lhbpp -lrddntx -lrddcdx -lrddfpt -lhbsix -lhbusrrdd -lhbct -lgtwin -lhbdebug -Wl,--end-group


Quite simple and here we have the result :-)
Image
Here you have the PRG, .bat and .EXE files:
http://rapidshare.com/files/146158123/test.zip.html

Next stage, to recompile FWH using MinGW...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby driessen » Wed Sep 17, 2008 11:24 pm

Antonio,

Can you explain a little bit ?

What is MinGW and what can it mean to us in our FiveWin world ?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby Antonio Linares » Wed Sep 17, 2008 11:57 pm

Michel,

We are looking for a modern C compiler to build our EXEs with FWH and Harbour/xHarbour.

Borland C 5.5 is from year 2000. More recent Borland C compiler versions are difficult to locate as are distributed as part of C++ Builder (huge) demo versions, that can't be redistributed because licence restrictions, etc.

Microsoft forces us to install lots and lots of tools that we don't need and they are constantly changing them, and pushing towards .NET (a technology that they don't use themselves!).

Thats why we are start reviewing gcc (GNU C compiler) for Windows (named MinGW). As it is simple, modern and supported by lots of users. And it is free and open source.

The same way we migrated from Clipper to Harbour, now we have to start considering to migrate from Borland C 5.5 to an open source and modern C compiler.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Thu Sep 18, 2008 12:19 am

Antonio,

This is an exciting development! I look forward to more news.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby mmercado » Thu Sep 18, 2008 3:05 am

Antonio Linares wrote:We are looking for a modern C compiler to build our EXEs with FWH and Harbour/xHarbour.
Hi Antonio:

Does MinGW require a (x)Harbour's special build?

Regards.

Manuel Mercado
User avatar
mmercado
 
Posts: 782
Joined: Wed Dec 19, 2007 7:50 am
Location: Salamanca, Gto., México

Postby Antonio Linares » Thu Sep 18, 2008 6:44 am

Manuel,

We have not tested it yet, but all you have to do is build it using the xHarbour's provided make_gnu.bat, from the CVS files.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby driessen » Thu Sep 18, 2008 7:06 am

Antonio,

Thanks for your clear explanation.

How about using this C-compiler together with xHarbour Builder ?

Or do I have to ask this question to Patrick and his team ?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby Antonio Linares » Thu Sep 18, 2008 7:21 am

Michel,

You can not mix MinGW OBJ files with PellesC (the one used by xHB) OBJ files.

Our idea is to provide a FWH built with MinGW for those that want to use this open source compiler (used in Windows, Windows Mobile, Linux, Mac and iPhone).

But we will keep distributing the FWH built with Borland and Microsoft too, for those that want to keep using them.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu Sep 18, 2008 8:51 am

I have to admit that I am quite impressed with MinGW gcc quality :-)

It is reporting warnings that Borland neither Microsoft were not detecting.

the FWH version compiled with MinGW is almost ready :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu Sep 18, 2008 11:47 am

We already have a first release of FWH built with MinGW :-)

And it is working really fine!

It is going to be provided as a beta to the users of the just published FWH 8.09 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Roberto Parisi » Thu Sep 18, 2008 7:25 pm

What about performances against BCC55 on harbour executables built with it?
Roberto Parisi
 
Posts: 116
Joined: Thu Oct 13, 2005 5:14 pm
Location: Italy

Postby Antonio Linares » Thu Sep 18, 2008 7:29 pm

Roberto,

Its soon to talk about performance. As soon as betatesters use it, we will know their impressions and results.

But when we use MinGW to build Harbour here, it gets built real fast :-)

Faster than using Microsoft or Borland.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41460
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 126 guests