Page 1 of 2

xharbour with gcc (mingw)?

Posted: Tue Apr 12, 2016 2:23 pm
by pieter
Hello,

Can xharbour work with gcc (mingw)? Or is that only possible with harbour?

Pieter

Re: xharbour with gcc (mingw)?

Posted: Tue Apr 12, 2016 4:28 pm
by Antonio Linares
Pieter,

I don't know if xharbour supports MinGW.

Surely Enrico may help us on this

Re: xharbour with gcc (mingw)?

Posted: Tue Apr 12, 2016 5:07 pm
by Enrico Maria Giordano
Yes, it is on

http://www.whosaway.com

EMG

Re: xharbour with gcc (mingw)?

Posted: Wed Apr 13, 2016 6:53 am
by pieter
Enrico, Oké!, I have send an email to you. Pieter

Re: xharbour with gcc (mingw)? helloworld.prg testprogram

Posted: Thu Apr 14, 2016 9:16 am
by pieter
Hello :D ,

I have downloaded from http://www.whosaway.com/:
-mingw530.zip
-xhb10146_mingw53.zip

I want to compile and run a helloworld.prg program on operating system Windows 8

Code: Select all

//helloworld.prg
PROCEDURE Main()
    ? "Hello World!"
RETURN
 
I made this directory:
C:\XharbourWithMingwTestProgram
mingw530
xhb10146_mingw53
build-helloworld.bat (is now still an empty file)
helloworld.prg

Question: What is a good way to compile and run helloworld.prg?

I tried to understand mdir.bat (in C:\XharbourWithMingwTestProgram\xhb10146_mingw53\xharbour\winmake), but I am not sure whether this mdir.bat is good file to start with.

Does anybody have an idea?

Best regards,

Pieter

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 9:19 am
by Antonio Linares
Pieter,

Please review FWH\samples\buildg.bat to use MinGW

You can easily modify it to use it with xHarbour

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 9:51 am
by pieter
Antonio, Thanks,

I have modified buildg.bat:

if "%fwh%" == "" set fwh=C:\XharbourWithMingwTestProgram\fwh

set hdir=C:\XharbourWithMingwTestProgram\xhb10146_mingw53\xharbour
set hdirc=%hdir%\bin\harbour.exe
set hlibs=%hdir%\lib\gcc
set mingw=C:\XharbourWithMingwTestProgram\mingw530\MINGW530
set path=C:\XharbourWithMingwTestProgram\mingw530\MINGW530\bin

┌────────────────────────────────────────────────────────────────────────────┐
?FiveWin for Harbour 15.01 and GCC - Jan. 2015 Harbour development power │▄
?(c) FiveTech, 1993-2015 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8 │█
└────────────────────────────────────────────────────────────────────────────┘?
  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀?
Compiling...
xHarbour 1.2.3 Intl. (SimpLex) (Build 20160314)
Copyright 1999-2015, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'helloworld.prg' and generating preprocessed output to 'helloworld.ppo
'...
Generating C source output to 'helloworld.c'...
Done.
Lines 5, Functions/Procedures 1, pCodes 7
gcc: error: unrecognized command line option '-mno-cygwin'
* Link errors *

C:\XharbourWithMingwTestProgram>

I think the problem is with set hlibs=%hdir%\lib\gcc, I don't see a gcc directory in C:\XharbourWithMingwTestProgram\xhb10146_mingw53\xharbour\lib

Is this the problem?

Pieter

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 10:59 am
by ukoenig
Long time ago ( 2008 !!! )
I tested MingW with Antonio to get it working
have a look at my results, posted problems and samples

http://forums.fivetechsupport.com/viewt ... ilit=MingW

The project for testing
http://www.pflegeplus.com/DOWNLOADS/BRWtoolsMinGW2.zip

Code: Select all


# gcc make example for Windows, developed by FiveTech Software 

hdir=e:\harbour\harbour 
hdirc=$(hdir)\source\main\w32\mingw32\harbour.exe 
hlibs=$(hdir)\lib\w32\mingw32 
fwh=e:\fwh 
mingw=e:\mingw 
fwfiles=-lfivehg -lfivehgc 
w32files=-ldll -lsocket -luser32 -lwinspool -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -loleaut32 -luuid \-lwinmm -lvfw32 -lwsock32 -lmsimg32 
hbfiles=-lhbbtree -lhbclipsm -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbcurl -lhbfbird -lhbgd -lhbhpdf \-lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmisc -lhbmsql -lhbmysql -lmysqldll -lhbmzip \-lhbnf -lhbodbc -lodbc32 -lhbpcre -lhbpgsql -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 \-lhbtip -lhbusrrdd -lhbvm -lhbvpdf -lhbw32 -lhbzlib -lrddado -lrddads -lrddcdx -lrddfpt -lrddntx -lxhb 
libraries=$(fwfiles) -lgtgui $(w32files) $(hbfiles) 
libspath=-L$(mingw)\lib -L$(hlibs) -L$(fwh)\lib 

all : brwtools.exe 
    brwtools.exe 

PRG_OBJS = ./obj/brwtools.c  \
    ./obj/errsysw.c 

C_OBJS = ./obj/brwtools.o \
    ./obj/errsysw.o 

#C_OBJS = ./obj/one.o \ 
#         ./obj/two.o \ 
#         ./obj/three.o 

brwtools.exe : $(PRG_OBJS) $(C_OBJS) 
#if not exist brwtools.rc $(mingw)\bin\gcc -obrwtools.exe ./obj/brwtools.o ./obj/errsysw.o \-Wall -s -mwindows $(libspath) -mno-cygwin -Wl,--start-group $(libraries) -Wl,--end-group 
#if exist brwtools.rc $(mingw)\bin\gcc =
#   -obrwtools.exe 
#   ./obj/brwtools.o 
#   ./obj/errsysw.o _one.o \-Wall -s -mwindows $(libspath) -mno-cygwin -Wl,--start-group $(libraries) -Wl,--end-group 

test.exe : $(PRG_OBJS) $(C_OBJS) 
#   if not exist one.rc $(mingw)\bin\gcc -otest.exe ./obj/one.o ./obj/two.o ./obj/three.o \-Wall -s -mwindows $(libspath) -mno-cygwin -Wl,--start-group $(libraries) -Wl,--end-group 
#   if exist one.rc $(mingw)\bin\gcc -otest.exe ./obj/one.o ./obj/two.o ./obj/three.o _one.o \-Wall -s -mwindows $(libspath) -mno-cygwin -Wl,--start-group $(libraries) -Wl,--end-group 


#if not exist brwtools.rc $(mingw)\bin\gcc -obrwtools.exe ./obj/brwtools.o ./obj/errsysw.o \-Wall -s -mwindows $(libspath) -mno-cygwin -Wl,--start-group $(libraries) -Wl,--end-group 
#if exist brwtools.rc $(mingw)\bin\gcc -obrwtools.exe ./obj/brwtools.o ./obj/errsysw.o _one.o \-Wall -s -mwindows $(libspath) -mno-cygwin -Wl,--start-group $(libraries) -Wl,--end-group 

./obj/%.c : %.prg 
if not exist obj mkdir obj $(hdir)\source\main\w32\mingw32\harbour.exe $< -o$@ -n -I$(hdir)\include -I$(fwh)\include 
    
./obj/%.o : ./obj/%.c 
    gcc -c -o$@ -I$(hdir)\include $<    
    
./obj/%.o : %.c 
    gcc -c -o$@ -I$(hdir)\include $<    
 
best regards
Uwe :D

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 11:34 am
by pieter
Hello ukoenig:D, thank you. So something did worked:D, was it fivewin with harbour and/or xharbour?

I know that harbour works very well with mingw(it is very easy with hbmk2). I now want to get xharbour working with mingw(It not really neccesary to use fivewin for that at this moment)

I see mno-cygwin is missing. (unrecognized command line option '-mno-cygwin')

In buildg.bat: (see -mno-cygwin)
if not exist %1.rc %mingw%\bin\gcc -o%1.exe %1.o -Wall -s -mwindows -L%mingw%\lib -L%hlibs% -L%fwh%\lib -mno-cygwin -Wl,--start-group -lfivehg -lfivehgc -lgtgui -luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lgdiplus -lole32 -loleaut32 -lpsapi -loledlg -lmfcuia32 -lmsimg32 -lwin32k -lstdc++ -lversion -luuid -lwinmm -lvfw32 -lwsock32 -lshell32 -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbdebug -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmzip -lodbc32 -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb -lpng -Wl,--end-group

Does anybody know if I have do someting with cygwin? I thougth I have to do something with MingW.

Pieter

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 11:51 am
by ukoenig
Pieter,

all my tests are done with XHARBOUR.
I will have a closer look at my old tests and check with NEW fwh.

regards
Uwe :D

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 1:31 pm
by Antonio Linares
Pieter,

Please replace this:

I think the problem is with set hlibs=%hdir%\lib\gcc

with this:

set hlibs=%hdir%\lib

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 1:47 pm
by pieter
Antonio,

I did set hlibs=%hdir%\lib

Still the same error.

┌────────────────────────────────────────────────────────────────────────────┐
?FiveWin for Harbour 15.01 and GCC - Jan. 2015 Harbour development power │▄
?(c) FiveTech, 1993-2015 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8 │█
└────────────────────────────────────────────────────────────────────────────┘?
  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀?
Compiling...
xHarbour 1.2.3 Intl. (SimpLex) (Build 20160314)
Copyright 1999-2015, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'helloworld.prg' and generating preprocessed output to 'helloworld.ppo
'...
Generating C source output to 'helloworld.c'...
Done.
Lines 5, Functions/Procedures 1, pCodes 7
gcc: error: unrecognized command line option '-mno-cygwin'
* Link errors *

C:\XharbourWithMingwTestProgram>

In hlibs=%hdir%\lib there are only .a extensions:
libbmdbfcdx.a
libbmsixcdx.a
libcodepage.a
etc.

I will think further:D

Pieter

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 2:20 pm
by Antonio Linares
Pieter,

Remove the flag '-mno-cygwin' when calling gcc

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 2:25 pm
by pieter
Antonio,

I already tried that, I get this error.

┌────────────────────────────────────────────────────────────────────────────┐
?FiveWin for Harbour 15.01 and GCC - Jan. 2015 Harbour development power │▄
?(c) FiveTech, 1993-2015 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8 │█
└────────────────────────────────────────────────────────────────────────────┘?
  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀?
Compiling...
xHarbour 1.2.3 Intl. (SimpLex) (Build 20160314)
Copyright 1999-2015, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'helloworld.prg' and generating preprocessed output to 'helloworld.ppo
'...
Generating C source output to 'helloworld.c'...
Done.
Lines 5, Functions/Procedures 1, pCodes 7
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbcommon
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbcpage
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbcplr
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbct
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbdebug
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbhsx
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhblang
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbmacro
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbmainstd
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbpcre
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbpp
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbrdd
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbrtl
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbtip
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbusrrdd
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbvm
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbwin
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lhbzlib
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lrddcdx
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lrddfpt
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lrddntx
C:/XharbourWithMingwTestProgram/mingw530/MINGW530/bin/../lib/gcc/i686-w64-mingw3
2/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lxhb
collect2.exe: error: ld returned 1 exit status
* Link errors *

C:\XharbourWithMingwTestProgram>

But maybe this error is closer to the solution.

Pieter

Re: xharbour with gcc (mingw)?

Posted: Thu Apr 14, 2016 5:35 pm
by Antonio Linares
Pieter,

Please post here your modified batch file