Build your FWH app using hbmk2.exe and MSVC 32&64

Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Antonio Linares » Tue Apr 19, 2022 6:00 am

Using hbmk2.exe to build our FWH app 32 bits using Microsoft Visual Studio Community 2022:

test.hbp
Code: Select all  Expand view  RUN
-gui

-Ic:\fwh\include

test.prg

-Lc:\fwh\lib

-lFiveH32
-lFiveHC32

-lgdiplus
-lole32
-lOleDlg
-lversion

xhb.hbc
hbct.hbc
hbwin.hbc
hbmzip.hbc
hbziparc.hbc
hbfoxpro.hbc

-ldflag=/NODEFAULTLIB:msvcrt

test.rc
 


go32.bat
Code: Select all  Expand view  RUN
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
c:\harbour\bin\hbmk2 test.hbp -comp=msvc
test.exe


test.prg
Code: Select all  Expand view  RUN
#include "FiveWin.ch"

function Main()

   local oBmpTiled, oWnd, oMsgBar

   DEFINE BITMAP oBmpTiled RESOURCE "background"

   DEFINE WINDOW oWnd MENU BuildMenu() TITLE "My app"

   BuildBar( oWnd )

   DEFINE MSGBAR oMsgBar OF oWnd PROMPT "My app" NOINSET

   ACTIVATE WINDOW oWnd MAXIMIZED ;
      ON PAINT DrawTiled( hDC, oWnd, oBmpTiled )

   oBmpTiled:End()

return nil

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "&Files"
   ENDMENU

return oMenu  

function BuildBar( oWnd )

   local oBar

   DEFINE BUTTONBAR oBar OF oWnd 3D SIZE 70, 70

return nil


test.rc
Code: Select all  Expand view  RUN
background BITMAP c:\fwh\bitmaps\backgrnd\iosbg.bmp
regards, saludos

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

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Antonio Linares » Tue Apr 19, 2022 7:13 am

64 bits version using FWH 64 and MSVC 64 bits:

test64.hbp
Code: Select all  Expand view  RUN
-gui

-Ic:\fwh\include

test.prg

-Lc:\fwh\lib

-lFiveH64
-lFiveHC64

-lgdiplus
-lole32
-lOleDlg
-lversion

xhb.hbc
hbct.hbc
hbwin.hbc
hbmzip.hbc
hbziparc.hbc
hbfoxpro.hbc

-ldflag=/NODEFAULTLIB:msvcrt

test.rc
 


go64.bat
Code: Select all  Expand view  RUN
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
c:\harbour\bin\hbmk2 test64.hbp -comp=msvc64
test.exe


test.prg (same code as previous msg)
Code: Select all  Expand view  RUN
#include "FiveWin.ch"

function Main()

   local oBmpTiled, oWnd, oMsgBar

   DEFINE BITMAP oBmpTiled RESOURCE "background"

   DEFINE WINDOW oWnd MENU BuildMenu() TITLE "My app"

   BuildBar( oWnd )

   DEFINE MSGBAR oMsgBar OF oWnd PROMPT "My app" NOINSET

   ACTIVATE WINDOW oWnd MAXIMIZED ;
      ON PAINT DrawTiled( hDC, oWnd, oBmpTiled )

   oBmpTiled:End()

return nil

function BuildMenu()

   local oMenu

   MENU oMenu
      MENUITEM "&Files"
   ENDMENU

return oMenu  

function BuildBar( oWnd )

   local oBar

   DEFINE BUTTONBAR oBar OF oWnd 3D SIZE 70, 70

return nil


test.rc
Code: Select all  Expand view  RUN
background BITMAP c:\fwh\bitmaps\backgrnd\iosbg.bmp
regards, saludos

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

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Horizon » Wed Apr 20, 2022 6:45 am

Hi Antonio,

What is the advantage of hbmk2.exe?
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Antonio Linares » Wed Apr 20, 2022 9:53 am

Hakan,

Simplicity and easy of use
regards, saludos

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

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby vilian » Wed Apr 20, 2022 11:24 am

Good Morning Antonio,
I can´t find download for MSVC 2019. Could I try it with MSVC 2022?

Which option should us choose in this screen?
Image
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 982
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Antonio Linares » Wed Apr 20, 2022 4:48 pm

Vilian,

> Could I try it with MSVC 2022 ?

Please use 2022

Please select "desenvolvimiento para desktop com C++"
regards, saludos

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

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby vilian » Wed Apr 20, 2022 5:25 pm

Thank you Antonio,

I'm tryng to compile a little samples, but it's showing the error message bellow:
Code: Select all  Expand view  RUN
[vcvarsall.bat] Environment initialized for: 'x86'
hbmk2[testsql07]: Warning: Cannot find xhb.hbc (referenced from testsql07.hbp)
hbmk2[testsql07]: Warning: Cannot find hbct.hbc (referenced from testsql07.hbp)
hbmk2[testsql07]: Warning: Cannot find hbwin.hbc (referenced from testsql07.hbp)
hbmk2[testsql07]: Warning: Cannot find hbmzip.hbc (referenced from testsql07.hbp)
hbmk2[testsql07]: Warning: Cannot find hbziparc.hbc (referenced from testsql07.hbp)
hbmk2[testsql07]: Warning: Cannot find hbfoxpro.hbc (referenced from testsql07.hbp)


I'm using this content into testsql07.hbp:
Code: Select all  Expand view  RUN
-gui

-Ic:\fwh21\include

testsql07.prg

-Lc:\fwh21\lib

-lFiveH32
-lFiveHC32

-lgdiplus
-lole32
-lOleDlg
-lversion

xhb.hbc
hbct.hbc
hbwin.hbc
hbmzip.hbc
hbziparc.hbc
hbfoxpro.hbc

-ldflag=/NODEFAULTLIB:msvcrt


Where can i find these files that are missing?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 982
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Antonio Linares » Wed Apr 20, 2022 5:27 pm

Vilian,

Please do this:

git clone https://github.com/harbour/core harbour

so it gets cloned at c:\harbour
regards, saludos

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

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby vilian » Wed Apr 20, 2022 6:04 pm

Thank you ;)
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 982
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby csincuir » Thu Apr 21, 2022 2:15 pm

Hola Antonio,
He seguido los pasos que indicas, pero tengo el siguiente error, usando el test.prg:
Image

Que no encuentra la funcion BuildMenu()

Estoy utilizando el Harboour de MSVC20201019, Visual Studio 2022 y FWH22.03

Saludos

Carlos.
csincuir
 
Posts: 411
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby csincuir » Thu Apr 21, 2022 8:46 pm

Ya esta solucionado Antonio.
Le cambie el nombre a la funcion BuildMenu de tu Ejemplo a MenuSis y enlazo correctamente, y genero el ejecutable sin problema
No se porque no encontraba la funcion con el nombre original?

Saludos cordiales

Carlos
csincuir
 
Posts: 411
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Antonio Linares » Fri Apr 22, 2022 6:35 am

Carlos,

Ya habiamos detectado ese bug y está arreglado para el próximo build de FWH :-)

Efectivamente la solución es cambiar el nombre de la función BuildMenu()
regards, saludos

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

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby csincuir » Fri Apr 22, 2022 6:10 pm

Enterado Antonio, gracias.
Seguiré ahora con tratar de armar un proyecto que ya tengo funcionando con Borland, y que quiero ahora tener con MSVC.

Saludos

Carlos.
csincuir
 
Posts: 411
Joined: Sat Feb 03, 2007 6:36 am
Location: Guatemala

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Horizon » Sat Apr 23, 2022 8:39 am

Antonio Linares wrote:Vilian,

Please do this:

git clone https://github.com/harbour/core harbour

so it gets cloned at c:\harbour


Hi Antonio,

After cloning, what should I do? There is not any binary file bin directory. Should I compile? How?

Thanks.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Antonio Linares » Sat Apr 23, 2022 10:42 am

Dear Hakan,

Please use these batch files to build Harbour 32 and 64 bits using Visual Studio Community 2022:

copy them into c:\harbour

You have to download OpenSSL 32 and 64 bits from here: https://slproweb.com/products/Win32OpenSSL.html and
curl from here: https://curl.se/download.html

go32.bat
Code: Select all  Expand view  RUN
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
set HB_COMPILER=msvc
set HB_BUILD_MODE=c
set HB_USER_PRGFLAGS=-l-
set HB_BUILD_CONTRIBS

rem set HB_BUILD_DEBUG=yes
rem set HB_TR_LEVEL=debug
rem set HB_USER_CFLAGS=-DHB_TR_LEVEL_DEBUG

set HB_WITH_OPENSSL=c:\OpenSSL-Win32\include
set HB_WITH_CURL=c:\curl\include
set HB_OPENSSL_STATIC=yes      
set HB_STATIC_OPENSSL=yes  
set HB_STATIC_CURL=yes
set HB_WITH_LIBHARU
set HB_BUILD_DYN=no
set HB_BUILD_CONTRIB_DYN=no
del .\src\common\obj\win\msvc\hbver.obj
del .\src\common\obj\win\msvc\hbver_dyn.obj
del .\src\common\obj\win\msvc\hbverdsp.obj
win-make.exe
copy c:\harbour\lib\win\msvc\libcurl-x32.lib c:\harbour\lib\win\msvc\libcurl.lib
copy c:\harbour\lib\win\msvc\libssl-1_1-x32.lib c:\harbour\lib\win\msvc\ssleay32.lib
copy c:\harbour\lib\win\msvc\libcrypto-1_1-x32.lib c:\harbour\lib\win\msvc\libcrypto.lib

go64.bat
Code: Select all  Expand view  RUN
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
set HB_COMPILER=msvc64
set HB_BUILD_MODE=c
set HB_USER_PRGFLAGS=-l-
set HB_BUILD_CONTRIBS

rem set HB_BUILD_DEBUG=yes
rem set HB_TR_LEVEL=debug
rem set HB_USER_CFLAGS=-DHB_TR_LEVEL_DEBUG

set HB_WITH_OPENSSL=c:\OpenSSL-Win64\include
set HB_WITH_CURL=c:\curl\include
set HB_OPENSSL_STATIC=yes      
set HB_STATIC_OPENSSL=yes  
set HB_STATIC_CURL=yes
set HB_WITH_LIBHARU
set HB_BUILD_DYN=no
set HB_BUILD_CONTRIB_DYN=no
del .\src\common\obj\win\msvc64\hbver.obj
del .\src\common\obj\win\msvc64\hbver_dyn.obj
del .\src\common\obj\win\msvc64\hbverdsp.obj
win-make.exe
copy c:\harbour\lib\win\msvc64\libcurl-x64.lib c:\harbour\lib\win\msvc64\libcurl.lib
copy c:\harbour\lib\win\msvc64\libssl-1_1-x64.lib c:\harbour\lib\win\msvc64\ssleay32.lib
copy c:\harbour\lib\win\msvc64\libcrypto-1_1-x64.lib c:\harbour\lib\win\msvc64\libcrypto.lib
regards, saludos

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests