Compiling with minigw

Compiling with minigw

Postby Maurizio » Wed Jul 18, 2012 7:21 am

Hello Antonio
I'm trying minigw with buildg.bat ( Fw 12.4)

this is my path :

if "%fwh%" == "" set fwh=.\..

set hdir=c:\HB30
set hdirc=%hdir%\bin\harbour.exe
set hlibs=%hdir%\lib\win\mingw
set mingw=C:\hb30\comp\mingw
set path=C:\hb30\comp\mingw\bin



this is the error



┌────────────────────────────────────────────────────────────────────────────┐
│ FiveWin for Harbour 12.04 and GCC - Apr. 2012 Harbour development power │▄
│ (c) FiveTech, 1993-2012 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7 │█
└────────────────────────────────────────────────────────────────────────────┘█
  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Compiling...
Harbour 3.0.0 (Rev. 16951)
Copyright (c) 1999-2011, http://harbour-project.org/
Compiling 'ALERT.prg' and generating preprocessed output to 'ALERT.ppo'...
Lines 5272, Functions/Procedures 2
Generating C source output to 'ALERT.c'... Done.
.\..\lib/fivehgc.lib(PROFILE.o):PROFILE.C:(.text+0x5d): undefined reference to `__chkstk_ms'
.\..\lib/fivehgc.lib(PROFILE.o):PROFILE.C:(.text+0x177): undefined reference to `__chkstk_ms'
.\..\lib/fivehgc.lib(C5CNEW.o):C5CNEW.C:(.text+0x63bd): undefined reference to `__chkstk_ms'
collect2: ld returned 1 exit status
* Link errors *


Regards Maurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Compiling with minigw

Postby Antonio Linares » Wed Jul 18, 2012 10:22 am

Maurizio,

Those problems have been solved on FWH 12.06:

Image
regards, saludos

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

Re: Compiling with minigw

Postby Maurizio » Wed Jul 18, 2012 2:51 pm

Antonio ,

OK with 12.06 works ,

is possible compilink with hbmk2.exe ?

I Try with gccmake.zip

HB:C:\fwh_06\1>go

HB:C:\fwh_06\1>PATH=C:\hb30\comp\mingw\bin;C:\hb30\comp\mingw\bin;C:\hb30\comp\mingw\bin;C:\hb30\comp\mingw\bin;C:\MinGW\bin;C:\
MinGW\bin;C:\MinGW\bin;C:\hb30\comp\mingw\bin

HB:C:\fwh_06\1>if not exist obj md obj

HB:C:\fwh_06\1>win-make -ftest.mak
if not exist obj mkdir obj
c:\HB30\bin\harbour.exe one.prg -oobj/one.c -n -Ic:\HB30\include -Ic:\fwh_06\include
Harbour 3.0.0 (Rev. 16951)
Copyright (c) 1999-2011, http://harbour-project.org/
Compiling 'one.prg'...
Lines 3874, Functions/Procedures 1
Generating C source output to 'obj/one.c'... Done.
if not exist obj mkdir obj
c:\HB30\bin\harbour.exe two.prg -oobj/two.c -n -Ic:\HB30\include -Ic:\fwh_06\include
Harbour 3.0.0 (Rev. 16951)
Copyright (c) 1999-2011, http://harbour-project.org/
Compiling 'two.prg'...
Lines 3, Functions/Procedures 1
Generating C source output to 'obj/two.c'... Done.
gcc -c -oobj/one.o -Ic:\HB30\include obj/one.c
gcc -c -oobj/two.o -Ic:\HB30\include obj/two.c
gcc -c -oobj/three.o -Ic:\HB30\include three.c
if not exist one.rc C:\hb30\comp\mingw\bin\gcc -otest.exe ./obj/one.o ./obj/two.o ./obj/three.o \
-Wall -s -mwindows -LC:\hb30\comp\mingw\lib -Lc:\HB30\lib\win\mingw -Lc:\fwh_06\lib -mno-cygwin -Wl,--start-group -lfivehg -lfiv
ehgc -lgtgui -ldll -lsocket -luser32 -lwinspool -lcomctl32 -lcomdlg32 -lgdi32 -lole32 -loleaut32 -luuid -lwinmm -lvfw32 -lwsock3
2 -lmsimg32 -llibhbbtree -lhbclipsm -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbcurl -lhbfbird -lhbgd -lhbhpdf -lhbhsx -lhblang -lh
bmacro -lhbmainstd -lhbmisc -lhbmsql -lhbmysql -lmysqldll -lhbmzip -lhbnf -lhbodbc -lodbc32 -lhbpcre -lhbpgsql -lhbpp -lhbrdd -l
hbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbvpdf -lhbw32 -lhbzlib -lrddado -lrddads -lrddcdx -lrddfpt -lrddntx -lxhb
-Wl,--end-group
c:/hb30/comp/mingw/bin/../lib/gcc/mingw32/4.5.2-dw2/../../../../mingw32/bin/ld.exe: cannot find -ldll
c:/hb30/comp/mingw/bin/../lib/gcc/mingw32/4.5.2-dw2/../../../../mingw32/bin/ld.exe: cannot find -lsocket
c:/hb30/comp/mingw/bin/../lib/gcc/mingw32/4.5.2-dw2/../../../../mingw32/bin/ld.exe: cannot find -llibhbbtree
c:/hb30/comp/mingw/bin/../lib/gcc/mingw32/4.5.2-dw2/../../../../mingw32/bin/ld.exe: cannot find -lhbmsql
c:/hb30/comp/mingw/bin/../lib/gcc/mingw32/4.5.2-dw2/../../../../mingw32/bin/ld.exe: cannot find -lmysqldll
c:/hb30/comp/mingw/bin/../lib/gcc/mingw32/4.5.2-dw2/../../../../mingw32/bin/ld.exe: cannot find -lhbvpdf
c:/hb30/comp/mingw/bin/../lib/gcc/mingw32/4.5.2-dw2/../../../../mingw32/bin/ld.exe: cannot find -lhbw32
c:/hb30/comp/mingw/bin/../lib/gcc/mingw32/4.5.2-dw2/../../../../mingw32/bin/ld.exe: cannot find -lrddado
collect2: ld returned 1 exit status
win-make: *** [test.exe] Error 1
HB:C:\fwh_06\1>



Maurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Compiling with minigw

Postby Antonio Linares » Wed Jul 18, 2012 3:36 pm

Maurizio,

This is the closer I have just tried:

set path=c:\mingw\bin
c:\harbour\bin\hbmk2 tutor02 -compiler=mingw -ic:\fwh\include -lfivehg.a -lfivehgc.a -lhbwin.a -Lc:\fwh\lib

I understand that hbmk2 is easy, but its sources are really complex in case that it may not work as desired...

I do prefer FWH buildg.bat, much simpler and easy to modify
regards, saludos

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

Re: Compiling with minigw

Postby Maurizio » Wed Jul 18, 2012 3:58 pm

Thank Antonio ,

I also prefer to use FWH buildg.bat

but with FWH\makes\gccmake.zip and win-make.exe I have the errors above

Maurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Compiling with minigw

Postby Antonio Linares » Wed Jul 18, 2012 4:20 pm

Maurizio,

This Makefile seems to be working fine :-)

Code: Select all  Expand view
# gcc make example for Windows, developed by FiveTech Software

hdir=c:\harbour
hdirc=$(hdir)\bin\harbour.exe
hlibs=$(hdir)\lib\gcc
fwh=c:\fwh
mingw=c:\mingw
fwfiles=-lfivehg -lfivehgc
winfiles=-luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lgdiplus -lole32 -loleaut32 -lpsapi -loledlg -lmfcuia32 -lmsimg32 -lwin32k -lstdc++ -lversion -luuid -lwinmm -lvfw32 -lwsock32
hbfiles=-lhbcommon -lhbcpage -lhbcplr -lhbct -lhbhpdf \
     -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmisc -lhbmzip \
     -lhbnf -lhbodbc -lodbc32 -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 \
     -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb
libraries=$(winfiles) $(fwfiles) -lgtgui $(hbfiles)
libspath=-L$(mingw)\lib -L$(hlibs) -L$(fwh)\lib

all : test.exe
    test.exe

PRG_OBJS = ./obj/one.c \
                     ./obj/two.c

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

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 $(libspath) -mno-cygwin -Wl,--start-group $(libraries) -Wl,--end-group

./obj/%.c : %.prg
    if not exist obj mkdir obj
    $(hdir)\bin\harbour.exe $< -o$@ -n -I$(hdir)\include -I$(fwh)\include
   
./obj/%.o : ./obj/%.c
    $(mingw)\bin\gcc -c -o$@ -I$(hdir)\include $<   
   
./obj/%.o : %.c
    gcc -c -o$@ -I$(hdir)\include $<   
 
regards, saludos

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

Re: Compiling with minigw

Postby ADutheil » Wed Jul 18, 2012 7:54 pm

I have been using hbmk2 from a nightly build downloaded from harbour site with no problem.
Version: Harbour 3.2.0dev (Rev. 17445)
Compiler: MinGW GNU C 4.6.1 (32-bit)
I use a simple .bat file.
Code: Select all  Expand view

SET PATH=e:\hb32\comp\mingw;e:\hb32\bin\;C:\WINDOWS;C:\WINDOWS\SYSTEM32
hbmk2 -inc -ldflag={allgcc}-Wl,--allow-multiple-definition -ic:\fwh\include -iincludes vav.hbm c:\fwh\fwhgc.hbc
 

where includes is a directory of my application directory.

vav.hbm
Code: Select all  Expand view

C:\PROJETOS\VAVLOG\SOURCES\VAV.PRG
C:\PROJETOS\VAVLOG\SOURCES\VAV_PRV.PRG
C:\PROJETOS\VAVLOG\SOURCES\VAV_PRN.PRG
... all prgs
C:\PROJETOS\VAVLOG\RES\VAV.RES
 


fwhgc.hbc
Code: Select all  Expand view

{win}libpaths=lib
{win}incpaths=include
{win}gt=gtgui
{win}libs=kernel32 comctl32 comdlg32 gdi32 ole32 oleaut32 psapi msimg32 win32k oledlg stdc++ mfcuia32 version uuid winmm vfw32 wsock32 gcc
{win}libs=hbwin hbct xhb hbmemio hbmisc png hbtip
{win}libs=fivehg fivehgc
 


I use hbmk2 with BCC582 and MSVC too.
Regards,

André Dutheil
FWH 13.04 + HB 3.2 + MSVS 10
ADutheil
 
Posts: 368
Joined: Sun May 31, 2009 6:25 pm
Location: Salvador - Bahia - Brazil

Re: Compiling with minigw

Postby Antonio Linares » Thu Jul 19, 2012 11:37 am

André,

Thanks! :-)
regards, saludos

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

Re: Compiling with minigw

Postby Maurizio » Thu Jul 19, 2012 1:28 pm

Hello Antonio ,

with these changes your make works
Code: Select all  Expand view
# gcc make example for Windows, developed by FiveTech Software


hdir=c:\HB30
hdirc=$(hdir)\bin
hlibs=$(hdir)\lib\win\mingw
fwh=c:\fwh_06
mingw=C:\hb30\comp\mingw



fwfiles=-lfivehg -lfivehgc
winfiles=-luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lgdiplus -lole32 -loleaut32 -lpsapi -loledlg -lmfcuia32 -lmsimg32 -lwin32k -lstdc++ -lversion -luuid -lwinmm -lvfw32 -lwsock32
hbfiles=-lhbcommon -lhbcpage -lhbcplr -lhbct -lhbhpdf \
     -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmisc -lhbmzip \
     -lhbnf -lhbodbc -lodbc32 -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 \
     -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb
libraries=$(winfiles) $(fwfiles) -lgtgui $(hbfiles)
libspath=-L$(mingw)\lib -L$(hlibs) -L$(fwh)\lib

all : test.exe
    test.exe

PRG_OBJS = ./obj/one.c \
       ./obj/two.c

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

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 $(libspath) -mno-cygwin -Wl,--start-group $(libraries) -Wl,--end-group

./obj/%.c : %.prg
    if not exist obj mkdir obj
    $(hdirc)\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 $<   



Thanks



Hello André

Now I will try your nmake

Thanks
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Compiling with minigw

Postby Antonio Linares » Thu Jul 19, 2012 1:42 pm

Maurizio,

Yes, you have to set your own paths into it :-)
regards, saludos

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

Re: Compiling with minigw

Postby Maurizio » Thu Jul 19, 2012 4:16 pm

Antonio

in your make the problems are :
hdirc=$(hdir)\bin\harbour.exe
you have to change in
hdirc=$(hdir)\bin


in the FWH LIB for minigw missing some function :
TWEBCAM()
MAPILOGOFF()
MAPISENDMAIL()

Thanks MAurizo
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Compiling with minigw

Postby Maurizio » Fri Jul 20, 2012 1:08 pm

Antonio ,

do you cann try FHW\samples\TESTMAIL.PRG ? does't work .

Maurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Compiling with minigw

Postby Antonio Linares » Fri Jul 20, 2012 2:08 pm

Maurizio,

I am emailing you a modified Fivehcg.lib, thanks :-)
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests