xharbour with gcc (mingw)?

xharbour with gcc (mingw)?

Postby pieter » Tue Apr 12, 2016 2:23 pm

Hello,

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

Pieter
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: xharbour with gcc (mingw)?

Postby Antonio Linares » Tue Apr 12, 2016 4:28 pm

Pieter,

I don't know if xharbour supports MinGW.

Surely Enrico may help us on this
regards, saludos

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


Re: xharbour with gcc (mingw)?

Postby pieter » Wed Apr 13, 2016 6:53 am

Enrico, Oké!, I have send an email to you. Pieter
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

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

Postby pieter » Thu Apr 14, 2016 9:16 am

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  Expand view

//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
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: xharbour with gcc (mingw)?

Postby Antonio Linares » Thu Apr 14, 2016 9:19 am

Pieter,

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

You can easily modify it to use it with xHarbour
regards, saludos

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

Re: xharbour with gcc (mingw)?

Postby pieter » Thu Apr 14, 2016 9:51 am

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
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: xharbour with gcc (mingw)?

Postby ukoenig » Thu Apr 14, 2016 10:59 am

Long time ago ( 2008 !!! )
I tested MingW with Antonio to get it working
have a look at my results, posted problems and samples

viewtopic.php?f=3&t=12763&hilit=MingW

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

Code: Select all  Expand view


# 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
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xharbour with gcc (mingw)?

Postby pieter » Thu Apr 14, 2016 11:34 am

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
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: xharbour with gcc (mingw)?

Postby ukoenig » Thu Apr 14, 2016 11:51 am

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
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: xharbour with gcc (mingw)?

Postby Antonio Linares » Thu Apr 14, 2016 1:31 pm

Pieter,

Please replace this:

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

with this:

set hlibs=%hdir%\lib
regards, saludos

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

Re: xharbour with gcc (mingw)?

Postby pieter » Thu Apr 14, 2016 1:47 pm

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
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: xharbour with gcc (mingw)?

Postby Antonio Linares » Thu Apr 14, 2016 2:20 pm

Pieter,

Remove the flag '-mno-cygwin' when calling gcc
regards, saludos

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

Re: xharbour with gcc (mingw)?

Postby pieter » Thu Apr 14, 2016 2:25 pm

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
User avatar
pieter
 
Posts: 117
Joined: Thu Jan 08, 2015 9:27 am

Re: xharbour with gcc (mingw)?

Postby Antonio Linares » Thu Apr 14, 2016 5:35 pm

Pieter,

Please post here your modified batch file
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42074
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 80 guests