FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Harbour and xHarbour para MingW GCC1501
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 10:18 AM
I'm using buildg.bat with this change:
if exist %1.rc %mingw%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -i%1.rc -o_%1.o --preprocessor "gcc -E -xc-header -include windows.h"
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 10:58 AM
Ahora entiendo por qué casi nadie quiere usar este compilador. Creo que me rendiré, volveré a mi amado Borland BCC77 Y XHARBOUR.
El compilador es bueno, pero está lleno de trampas y requiere mucho trabajo.

Now I understand why almost no one wants to use this compiler. I think I'll give up and go back to my beloved Borland BCC77 and XHARBOUR.
The compiler is good, but it's full of pitfalls and requires a lot of work.
if exist %1.rc %mingw%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -i%1.rc -o_%1.o --preprocessor "gcc -E -xc-header -include windows.h"

Khbmk2: Processing environment options: -comp=mingw
hbmk2: Compiling Harbour sources...
Harbour 3.2.0dev (r2503251254)
Copyright (c) 1999-2024, https://harbour.github.io/
hbmk2: Compiling resources...
C:/SENDMAIL/ACBRREAL.rc:300: fatal error: when writing output to : Invalid argument
compilation terminated.
windres.exe: C:/SENDMAIL/ACBRREAL.rc:10: syntax error
windres.exe: preprocessing failed.
hbmk2[Proj]: Error: Running resource compiler. 1
windres.exe -IC:/HBGCC151/include -IC:/HBGCC151/contrib/hbwin -IC:/HBGCC151/contrib/hbct -IC:/HBGCC151/contrib/xhb -IC:/HBGCC151/contrib/hbtip -IC:/HBGCC151/contrib/hbfship -IC:/HBGCC151/contrib/hbxpp -IC:/HBGCC151/contrib/hbmzip -IC:/HBGCC151/contrib/hbcomm -IC:/HBGCC151/contrib/hbcurl C:/SENDMAIL/ACBRREAL.rc -O coff -o C:/SENDMAIL/ACBRREAL.reso
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 11:02 AM

Can I see the compile batch you are using? I repeat: it works perfectly fine here.

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 11:07 AM
PROJ.HBP
#VisualFW MingW make, (c) FiveTech Software 2005-2025 - 18/05/2025 - Joao
#Special Thanks To: Giovany Vecchi <giovanyvecchi@gmail.com>

#flags
#-inc
-rebuild
-a
-m
-n
-w1
-es0
-gc1
-q
-v
-p
-gui
-map
-o${OuputExe}\${ExeName}
-workdir=C:\SENDMAIL\
#-run

########## PRGs - Inclua todos os PRGs individualmente ou *.Prg para todos os PRGs da pasta
########## O primeiro PRG deve-se incluir separadamente no inicio
C:\SENDMAIL\SENDMAIL.prg

########## <MODULOS AUXILIARES>
#C:\SENDMAIL\ICON.prg

########## RESOURCES INPUTS RAW > Caso tenha o arquivo em .RC desmarque o mesmo no binario
C:\SENDMAIL\ACBRREAL.rc
C:\SENDMAIL\VERSION.rc

########## RESOURCES INPUTS BINARES > Apenas Resources Binarios sem arquivos RC
#C:\SENDMAIL\ACBRREAL.res
C:\SENDMAIL\EMAIL.res
C:\SENDMAIL\IMAGENS.res
C:\SENDMAIL\IMAGEN2.res

######### SOURCES HARBOUR AND CONTRIBS
hbwin.hbc
hbct.hbc
xhb.hbc
hbziparc.hbc
hbmzip.hbc
hbcomm.hbc
hbcurl.hbc

######### LIBS HARBOUR GCC(MingW)
-luser32
-lwinspool 
-lkernel32
-lcomctl32 
-lcomdlg32 
-lgdi32 
-lgdiplus 
-lole32 
-loleaut32 
-lpsapi 
-loledlg 
-lmfcuia32 
-lmsimg32 
-lwin32k 
-lstdc++ 
-lversion 
-luuid 
-lwinmm 
-lvfw32 
-lwsock32
-lshell32
-static
-lgtgui
-lshell32
-lmpr
-lhbct
-lhbmainstd
-lhbmzip
-lodbc32
-lhbsqlit3
-lhbtip
-lhbwin
-lxhb
-lhbziparc
-lminizip
-lhbmzip
-lhbziparc
-lpng
-L{MinGw_Dir}\lib

######### LIBS FIVEWIN
-lfivehg
-lfivehgc
-L${Fwh_Dir}\lib

# ----------------------- kapiabafwh@gmail.com ------------------------------
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 11:09 AM
PROJ.BAT
REM VisualFW MingW make, (c) FiveTech Software 2005-2025 - 16/05/2025 - Joao
REM Special Thanks To: Giovany Vecchi <giovanyvecchi@gmail.com>
REM Bibliotecas obrigatorias do GCC que tem que enviar ao cliente:
REM C:\MINGW\BIN
REM libgcc_s_dw2-1.dll
REM libstdc++-6.dll
REM libwinpthread-1.dll

Echo on
cls
Rem Variaveis de ambientes dos caminhos(path) de FWH, Harbour e Mingw
set Fwh_Dir=C:\FWH
set HarbourGcc_Dir=C:\HBGCC151
Set MinGw_Dir=C:\MinGw
Set INCLUDE=%HarbourGcc_Dir%\include;%Fwh_Dir%\include;%MinGw_Dir%\include;%MinGw_Dir%\i686-w64-mingw32\include

Rem Pasta onde o executavel vai ser gravado e nome do executavel sem informar .exe
Set OuputExe=C:\SENDMAIL\
Set ExeName=SENDMAIL

IF EXIST %OuputExe%\%ExeName%.exe Del %OuputExe%\%ExeName%.exe

SET oldpath=%Path%
SET PATH=%HarbourGcc_Dir%\bin;%MinGw_Dir%\bin
SET INCLUDE=%HarbourGcc_Dir%\include;%Fwh_Dir%\include;%MinGw_Dir%\include
SET HB_INSTALL_PREFIX=%HarbourGcc_Dir%

SET HB_LANG=PT_BR

SET HB_USER_CFLAGS=-c -D_WIN32 -D__HARBOUR__ -D__FLAT__
SET HB_COMPILER=mingw

REM if exist ACBRREAL.rc %MinGw_Dir%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -iACBRREAL.rc -o_ACBRREAL.o --preprocessor "gcc -E -xc-header -include windows.h"

%HarbourGcc_Dir%\bin\win\mingw\HBMK2.EXE C:\SENDMAIL\Proj.hbp %* -comp=mingw > ERROS.log 2>&1
PATH=%oldpath%

REM Pause

REM IF EXIST SENDMAIL.EXE C:\PECOMPACT\PEC2 /NB /EMP:Y /TM:Y /CR:Y /MC /EMO:I SENDMAIL.EXE
REM IF EXIST SENDMAIL.EXE C:\UPX4\UPX.EXE --lzma SENDMAIL.exe

IF EXIST %OuputExe%\%ExeName%.exe %OuputExe%\%ExeName%.exe

REM FIN / END
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 12:34 PM
This is commented out.
karinha wrote:REM if exist ACBRREAL.rc %MinGw_Dir%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -iACBRREAL.rc -o_ACBRREAL.o --preprocessor "gcc -E -xc-header -include windows.h"
Anyway, please try using buildg.bat with my change.
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 01:19 PM
Enrico Maria Giordano wrote: This is commented out.
REM if exist ACBRREAL.rc %MinGw_Dir%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -iACBRREAL.rc -o_ACBRREAL.o --preprocessor "gcc -E -xc-header -include windows.h"
Anyway, please try using buildg.bat with my change.
Enrico, BUILDG.BAT funciona muy bien, pero solo sirve para compilar la pasta de \samples. Estoy planeando un proyecto completo, en este caso, BUILDG.BAT no me sirve.

Gracias, tks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 02:42 PM

You can easily add new PRGs and new LIBs to buildg.bat. Or you can develop your own batch based on buildg.bat. If buildg.bat is working fine for you, the problem is most likely in your current compile batch.

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 03:03 PM
Enrico Maria Giordano wrote: You can easily add new PRGs and new LIBs to buildg.bat. Or you can develop your own batch based on buildg.bat. If buildg.bat is working fine for you, the problem is most likely in your current compile batch.
No puedo generar un .BAT basado en BUILDG.BAT porque no genera un archivo como B32.BC desde BORLAND BCC. ¿Puedes generar?

I can't generate a .BAT based on BUILDG.BAT because it doesn't generate a file like B32.BC from BORLAND BCC. Can you generate it?

Eso es lo que vengo pidiendo desde el principio del tema.

That's what I've been asking for since the beginning of the topic.

Gracias, tks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 03:09 PM

I don't understand. You can easily adapt buildg.bat to your needs. How can I help you more?

Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 03:28 PM
Enrico Maria Giordano wrote: I don't understand. You can easily adapt buildg.bat to your needs. How can I help you more?
How? Please show me. I have no idea how to do it.

¿Como? Muéstramelo por favor. No tengo idea de cómo hacerlo.

Gracias, tks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 03:32 PM
The first step is to add more lines like this, one for each PRG you want to compile:
%hdirc% myprg1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 05:24 PM
Enrico, ¿qué estoy haciendo mal al incorporar el recurso?
@ECHO ON
CLS
ECHO Compiling...

SET hdir=c:\HBGCC151
SET hdirc=%hdir%\bin\win\mingw\harbour.exe
SET hlibs=%hdir%\lib\win\mingw
SET mingw=c:\gcc1501
SET path=%mingw%\bin
SET fwh=C:\FwH1905

REM // Generando el .c
%hdirc% TUTOR01 /m /n /i%fwh%\include;%hdir%\include /w /p %2 %3  > comp.log 2>  warnings.log
%hdirc% TUTOR02 /m /n /i%fwh%\include;%hdir%\include /w /p %2 %3 >> comp.log 2>> warnings.log
%hdirc% TUTOR03 /m /n /i%fwh%\include;%hdir%\include /w /p %2 %3 >> comp.log 2>> warnings.log
%hdirc% TUTOR04 /m /n /i%fwh%\include;%hdir%\include /w /p %2 %3 >> comp.log 2>> warnings.log

IF ERRORLEVEL 1 GOTO COMPILEERROR

REM // Generando el .o = .obj
%mingw%\bin\gcc -c -w TUTOR01.c -oTUTOR01.o -I%hdir%\include -I%mingw%\include >> comp.log 2>> warnings.log
%mingw%\bin\gcc -c -w TUTOR02.c -oTUTOR02.o -I%hdir%\include -I%mingw%\include >> comp.log 2>> warnings.log
%mingw%\bin\gcc -c -w TUTOR03.c -oTUTOR03.o -I%hdir%\include -I%mingw%\include >> comp.log 2>> warnings.log
%mingw%\bin\gcc -c -w TUTOR04.c -oTUTOR04.o -I%hdir%\include -I%mingw%\include >> comp.log 2>> warnings.log

rem Enrico, aqui no funciono que esta errado?
IF ERRORLEVEL 1 GOTO COMPILEERROR // ????

if exist tutor04.rc %mingw%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -itutor04.rc -o_tutor04.o

ECHO

:RESOURCESERROR
ECHO * Resources errors *
GOTO EXIT

:COMPILEERROR
@type comp.log
ECHO * Compile errors *
GOTO EXIT

:LINKERROR
ECHO * Link errors *
GOTO EXIT

:SINTAX
ECHO    ERROR
ECHO    NAO COMPILOU
GOTO EXIT

:NOEXIST
ECHO The specified PRG does not exist

:EXIT
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 06:17 PM
karinha wrote:Enrico, ¿qué estoy haciendo mal al incorporar el recurso?
if exist tutor04.rc %mingw%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -itutor04.rc -o_tutor04.o
I already told you: just add
if exist tutor04.rc %mingw%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -itutor04.rc -o_tutor04.o --preprocessor "gcc -E -xc-header -include windows.h"
And, of course, remove #include <windows.h> from you RC file.
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Harbour and xHarbour para MingW GCC1501
Posted: Thu May 22, 2025 07:00 PM

Que dificil! jajajaja.

tutor04.rc:2: unrecognized escape sequence

tutor04.rc:2: unrecognized escape sequence

Regards, saludos.

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341