FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Build your FWH app using hbmk2.exe and MSVC 32&64
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Sat Apr 23, 2022 06:01 PM

Antonio, para salir de dudas de una vez por todas....

Que version de ssl descargar tanto para bcc como para msvc? en sus versiones 32 y 64 bits..

Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Sat Apr 23, 2022 06:26 PM
Carlos,

Para 32 bits prueba con:
https://slproweb.com/download/Win32OpenSSL-3_0_2.exe

Para 64 bits prueba con:
https://slproweb.com/download/Win64OpenSSL-1_1_1n.exe

En la página de descargas tambien hay unas versiones "light" que podríamos probar.

Yo los tengo descargados desde hace tiempo y no recuerdo si los descargué desde ahi
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Mon Apr 25, 2022 07:58 PM
Antonio Linares wrote:Carlos,

Para 32 bits prueba con:
https://slproweb.com/download/Win32OpenSSL-3_0_2.exe

Para 64 bits prueba con:
https://slproweb.com/download/Win64OpenSSL-1_1_1n.exe

En la página de descargas tambien hay unas versiones "light" que podríamos probar.

Yo los tengo descargados desde hace tiempo y no recuerdo si los descargué desde ahi


Hi Antonio,

Can you please lead me to compile after installing Win32OpenSSL-3_0_2.exe?

Thanks.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Tue Apr 26, 2022 09:36 AM

Dear Hakan,

We already explained it here:

viewtopic.php?p=249800sid=cf5b3f87e1f151243044e5d25dfd8ca0#p249800

Just run go32.bat to get Harbour 32 bits, or run go64.bat to get Harbour 64 bits

&

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Sat Jun 25, 2022 09:17 AM

Previous post updated including:

set HB_WITH_LIBHARU

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Mon Jun 03, 2024 10:33 AM
Antonio Linares wrote:64 bits version using FWH 64 and MSVC 64 bits:

test64.hbp
Code (fw): Select all Collapse
-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 (fw): Select all Collapse
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 (fw): Select all Collapse
#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 (fw): Select all Collapse
background BITMAP c:\fwh\bitmaps\backgrnd\iosbg.bmp
Hi Antonio,

I have found fwh64 2307 from my backups and started again from begining. I am trying to compile your example. It gives some errors. Can you please help me.

Thanks.
Code (fw): Select all Collapse
C:\fwh64\samples>gohbmk

C:\fwh64\samples>call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd6
**********************************************************************
** Visual Studio 2022 Developer Command Prompt v17.10.0
** Copyright (c) 2022 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Harbour 3.2.0dev (r2405130039)
Copyright (c) 1999-2021, https://harbour.github.io/
Compiling 'testhbmk.prg'...
Lines 5062, Functions/Procedures 3
Generating C source output to 'C:\Users\Hakan\AppData\Local\Temp\hbmk_uywgm5.dir\testhbmk.c'... Done.
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Copyright (C) Microsoft Corporation.  All rights reserved.

testhbmk.c
LINK : warning LNK4217: symbol 'ceil' defined in 'libucrt.lib(ceil.obj)' is imported by 'hbct.lib(ctmath2.obj)' in function 'HB_FUN_CEILING'
LINK : warning LNK4286: symbol 'ceil' defined in 'libucrt.lib(ceil.obj)' is imported by 'rddntx.lib(dbfntx1.obj)'
LINK : warning LNK4286: symbol 'ceil' defined in 'libucrt.lib(ceil.obj)' is imported by 'rddcdx.lib(dbfcdx1.obj)'
LINK : warning LNK4286: symbol 'fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'hbcplr.lib(genhrb.obj)'
LINK : warning LNK4217: symbol 'fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'hbcplr.lib(compi18n.obj) in function 'hb_compI18nAddSingle'
LINK : warning LNK4286: symbol 'fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol 'fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'minizip.lib(ioapi.obj)' function 'fclose_file_func'
LINK : warning LNK4286: symbol 'fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'hbrtl.lib(errintlo.obj)'
LINK : warning LNK4286: symbol 'fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'hbcplr.lib(hbmain.obj)'
LINK : warning LNK4286: symbol 'fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'hbcplr.lib(genc.obj)'
LINK : warning LNK4217: symbol 'fopen' defined in 'libucrt.lib(fopen.obj)' is imported by 'minizip.lib(ioapi.obj)' in function 'fopen64_file_func'
LINK : warning LNK4217: symbol 'fread' defined in 'libucrt.lib(fread.obj)' is imported by 'minizip.lib(ioapi.obj)' in function 'fread_file_func'
LINK : warning LNK4286: symbol 'fread' defined in 'libucrt.lib(fread.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol 'fseek' defined in 'libucrt.lib(fseek.obj)' is imported by 'minizip.lib(ioapi.obj)' in function 'fseek_file_func'
LINK : warning LNK4286: symbol 'fseek' defined in 'libucrt.lib(fseek.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol '_fseeki64' defined in 'libucrt.lib(fseek.obj)' is imported by 'minizip.lib(ioapi.obj) in function 'fseek64_file_func'
LINK : warning LNK4217: symbol 'ftell' defined in 'libucrt.lib(ftell.obj)' is imported by 'minizip.lib(ioapi.obj)' in function 'ftell_file_func'
LINK : warning LNK4286: symbol 'ftell' defined in 'libucrt.lib(ftell.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol '_ftelli64' defined in 'libucrt.lib(ftell.obj)' is imported by 'minizip.lib(ioapi.obj) in function 'ftell64_file_func'
LINK : warning LNK4217: symbol 'fwrite' defined in 'libucrt.lib(fwrite.obj)' is imported by 'minizip.lib(ioapi.obj)' function 'fwrite_file_func'
LINK : warning LNK4286: symbol 'fwrite' defined in 'libucrt.lib(fwrite.obj)' is imported by 'hbcplr.lib(genhrb.obj)'
LINK : warning LNK4286: symbol 'fwrite' defined in 'libucrt.lib(fwrite.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'hbvm.lib(hvmall.obj)' in function 'dlmalloc_stats'
LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'rddcdx.lib(dbfcdx1.obj)'
LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'hbcplr.lib(hbcomp.obj)'
LINK : warning LNK4286: symbol '__acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbcplr.lib(hbcomp.obj)'
LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbcplr.lib(genc.obj)'
LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbcplr.lib(compi18n.obj)'
LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbcplr.lib(gencc.obj)'
LINK : warning LNK4217: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbvm.lib(hvmall.obj)' in function '_vfprintf_l'
LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbrtl.lib(errintlo.obj)'
LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'rddcdx.lib(dbfcdx1.obj)'
LINK : warning LNK4286: symbol '__stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbcplr.lib(hbmain.obj)'
LINK : warning LNK4217: symbol 'abort' defined in 'libucrt.lib(abort.obj)' is imported by 'hbvm.lib(hvmall.obj)' in function 'add_segment'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcommon.lib(funcid.obj)'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbpcre.lib(pcrecomp.obj)'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(harboury.obj)'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(cmdcheck.obj)'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(genc.obj)'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(hbfunchk.obj)'
LINK : warning LNK4217: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbvm.lib(hvmall.obj)' in function 'hb_macroGenPopAliasedVar'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbrtl.lib(hbjson.obj)'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'rddntx.lib(dbfntx1.obj)'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(hbdbginf.obj)'
LINK : warning LNK4217: symbol 'atoi' defined in 'libucrt.lib(atox.obj)' is imported by 'hbvm.lib(cmdarg.obj)' in function 'hb_cmdargNum'
LINK : warning LNK4217: symbol 'atoi' defined in 'libucrt.lib(atox.obj)' is imported by 'hbrdd.lib(wafunc.obj)' in function 'hb_rddGetTempAlias'
LINK : warning LNK4286: symbol 'atoi' defined in 'libucrt.lib(atox.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol 'exit' defined in 'libucrt.lib(exit.obj)' is imported by 'hbrtl.lib(errint.obj)' in function 'hb_errInternal'
LINK : warning LNK4217: symbol 'fflush' defined in 'libucrt.lib(fflush.obj)' is imported by 'rddcdx.lib(dbfcdx1.obj)' in  function 'hb_cdxPageGetKeyVal'
LINK : warning LNK4286: symbol 'fflush' defined in 'libucrt.lib(fflush.obj)' is imported by 'hbcplr.lib(hbcomp.obj)'
LINK : warning LNK4286: symbol 'fflush' defined in 'libucrt.lib(fflush.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol 'qsort' defined in 'libucrt.lib(qsort.obj)' is imported by 'hbcplr.lib(hbmain.obj)' in function 'hb_compOptimizeJumps'
LINK : warning LNK4217: symbol 'fputc' defined in 'libucrt.lib(fputc.obj)' is imported by 'hbcplr.lib(genc.obj)' in function 'hb_compGenCFunc'
LINK : warning LNK4286: symbol 'fputc' defined in 'libucrt.lib(fputc.obj)' is imported by 'hbcplr.lib(gencc.obj)'
LINK : warning LNK4286: symbol 'fputc' defined in 'libucrt.lib(fputc.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol '_wfsopen' defined in 'libucrt.lib(fopen.obj)' is imported by 'hbcommon.lib(hbfopen.obj)' in function 'hb_fopen'
LINK : warning LNK4217: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'hbpcre.lib(pcreglob.obj)' in function 'LocalPcreFree'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'hbzlib.lib(zutil.obj)'
LINK : warning LNK4217: symbol 'malloc' defined in 'libucrt.lib(malloc.obj)' is imported by 'hbpcre.lib(pcreglob.obj)' in function 'LocalPcreMalloc'
LINK : warning LNK4286: symbol 'malloc' defined in 'libucrt.lib(malloc.obj)' is imported by 'hbzlib.lib(zutil.obj)'
hbct.lib(ctmath2.obj) : error LNK2019: unresolved external symbol __imp_floor referenced in function HB_FUN_FLOOR
minizip.lib(zip.obj) : error LNK2019: unresolved external symbol __imp_srand referenced in function crypthead
hbrtl.lib(arc4.obj) : error LNK2001: unresolved external symbol __imp_srand
minizip.lib(zip.obj) : error LNK2019: unresolved external symbol __imp_rand referenced in function crypthead
hbrtl.lib(arc4.obj) : error LNK2001: unresolved external symbol __imp_rand
minizip.lib(zip.obj) : error LNK2019: unresolved external symbol __imp__time64 referenced in function crypthead
minizip.lib(ioapi.obj) : error LNK2019: unresolved external symbol __imp_ferror referenced in function ferror_file_func
hbvm.lib(hvmall.obj) : error LNK2019: unresolved external symbol __imp__dclass referenced in function hb_itemStrBuf
hbcommon.lib(hbprintf.obj) : error LNK2001: unresolved external symbol __imp__dclass
hbvm.lib(hvmall.obj) : error LNK2019: unresolved external symbol __imp_modf referenced in function hb_itemStrBuf
hbrtl.lib(fstemp.obj) : error LNK2001: unresolved external symbol __imp_modf
hbcommon.lib(hbstr.obj) : error LNK2001: unresolved external symbol __imp_modf
hbcommon.lib(hbprintf.obj) : error LNK2001: unresolved external symbol __imp_modf
hbcplr.lib(hbmain.obj) : error LNK2019: unresolved external symbol __imp_fgetc referenced in function hb_compReadClpFile

hbpp.lib(ppcore.obj) : error LNK2001: unresolved external symbol __imp_fgetc
hbpp.lib(ppcore.obj) : error LNK2019: unresolved external symbol __imp_fputs referenced in function hb_pp_dumpEnd
hbcommon.lib(hbprintf.obj) : error LNK2019: unresolved external symbol __imp__dsign referenced in function hb_vsnprintf
hbpcre.lib(pcrecomp.obj) : error LNK2019: unresolved external symbol __imp_isdigit referenced in function pcre_compile2
testhbmk.exe : fatal error LNK1120: 11 unresolved externals
hbmk2[testhbmk]: Error: Running linker. 1120 link.exe @C:\Users\Hakan\AppData\Local\Temp\sceydp.lnk
hbmk2: Hint: Add option 'hbct.hbc' for missing function(s): Floor(), Ceiling()
'testhbmk.exe' is not recognized as an internal or external command,
operable program or batch file.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Mon Jun 03, 2024 11:20 AM
Use this Harbour 64: https://github.com/FiveTechSoft/harbour_and_xharbour_builds/blob/master/harbour_msvc2022_64_20240530.zip

go64.bat
Code (fw): Select all Collapse
@setlocal
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
c:\harbour\bin\win\msvc64\hbmk2 test64.hbp -comp=msvc64
@endlocal
test.exe
test64.hbp
Code (fw): Select all Collapse
-gui

-Ic:\fwh64\include

test.prg

-Lc:\fwh64\lib

-lFiveH64
-lFiveHC64

-lgdiplus
-lole32
-lOleDlg
-lversion
-lucrt 
-luxtheme

-ldflag=/NODEFAULTLIB:libucrt 
-ldflag=/NODEFAULTLIB:msvcrt

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

-ldflag=/NODEFAULTLIB:msvcrt

test.rc
test.prg
Code (fw): Select all Collapse
#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 (fw): Select all Collapse
background BITMAP c:\fwh64\bitmaps\backgrnd\iosbg.bmp
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Mon Jun 03, 2024 11:29 AM

Thank you Antonio,

It worked just fine.

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Mon Jun 03, 2024 05:26 PM

To All

I have used Borland for many years and I did try MSVC for a short while but I did not see any advantage to use MVSC vs Borland ?? .. I do not use Visual Studio.

Rick Lipkin

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Mon Jun 03, 2024 05:54 PM

One of the advantages of MSVC is the smaller executables sizes. Another one is the higher C compile speed if -MP switch is used (something similar exists for BCC64 and BCC32 CLANG, but not for BCC32).

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Tue Jun 04, 2024 05:55 AM
MSVC provides a great low level debugger and many useful tools

IMO the best one, no doubt about it :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Tue Jun 04, 2024 07:31 AM

Can the low level debugger be used without Visual Studio? If yes, how?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Tue Jun 04, 2024 07:41 AM

Dear Enrico,

> Can the low level debugger be used without Visual Studio? If yes, how?

You need to install the complete Visual Studio package as you run the low level debugger from the IDE

Its a great low level debugger where you can see the Harbour virtual machine running, step by step. Step through the C code, profile the C code execution to detect bottlenecks and more

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Build your FWH app using hbmk2.exe and MSVC 32&64
Posted: Tue Jun 04, 2024 07:45 AM

Ok, so the low level debugger should not listed as an advantage of MSVC.