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

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

Postby Antonio Linares » Tue Jun 04, 2024 8:44 am

To me is one of the key reasons to use 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: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Enrico Maria Giordano » Tue Jun 04, 2024 10:11 am

Yes, but it is a feature of Visual Studio, not of MSVC.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Horizon » Tue Jun 04, 2024 2:10 pm

Antonio Linares wrote:Dear Hakan,

We already explained it here:
viewtopic.php?p=249800&sid=cf5b3f87e1f151243044e5d25dfd8ca0#p249800

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


Hi Antonio,

I have installed git. and have cloned to harbour/core. I have installed https://slproweb.com/download/Win32OpenSSL-3_3_0.exe (first light version and than normal version) and curl 8.8.0.

I have copied go32.bat to c:\harbour directory and run go32.bat.

I think I must have done wrong. There is no success.

Code: Select all  Expand view
C:\harbour\bin\win\msvc\hbmk2 -quiet -width=0 -autohbm- @hbpre -inc hbamf/hbamf.
hbp @hbpost
C:\harbour\bin\win\msvc\hbmk2 -quiet -width=0 -autohbm- @hbpre -inc gtwvg/gtwvg.
hbp @hbpost
C:\harbour\bin\win\msvc\hbmk2 -quiet -width=0 -autohbm- @hbpre -inc gtqtc/gtqtc.
hbp @hbpost
hbmk2[gtqtc]: plugin: HB_WITH_QT, HB_QTPATH, HB_QTSUFFIX not set, could not auto
detect 'moc.exe' executable
hbmk2[gtqtc]: Exit status: 20: plugin initialization
C:\harbour\bin\win\msvc\hbmk2 -quiet -width=0 -autohbm- @hbpre -inc gtalleg/gtal
leg.hbp @hbpost
hbmk2[gtallegs]: Warning: Missing dependency: allegro
! Finished package build...
./bin/win/msvc/hbmk2.exe ./config/postinst.hb first
! postinst script finished
Sistem belirtilen dosyayı bulamıyor.
Sistem belirtilen dosyayı bulamıyor.
Sistem belirtilen dosyayı bulamıyor.
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 » Tue Jun 04, 2024 2:32 pm

Dear Hakan,

If you want to build Harbour yourself, please ask Enrico as he is currently the builds maintainer, thanks

We used to use this one:
Code: Select all  Expand view
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
set HB_BUILD_MODE=c
set HB_USER_PRGFLAGS=-l-
rem set HB_USER_CFLAGS=-MD -MP -O1
set HB_USER_CFLAGS=-MP
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:\curl32\include    
set HB_STATIC_CURL=yes
set HB_STATIC_OPENSSL=yes
set HB_WITH_LIBHARU
set HB_WITH_ADS="c:\software\Advantage 11.10\acesdk"
set HB_WITH_MYSQL="c:\software\MySQL\include"
set HB_BUILD_DYN=no
set HB_BUILD_CONTRIB_DYN=no
win-make.exe
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: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Enrico Maria Giordano » Tue Jun 04, 2024 2:45 pm

This is the batch I'm currently using:

Code: Select all  Expand view
@ ECHO OFF

CALL msc32 /paths

SET PATH=%MSC%\bin
SET HB_INSTALL_PREFIX=%cd%\harbour

SET INCLUDE=%MSC%\include\ucrt;%MSC%\include;%MSC%\include\sdk
SET LIB=%MSC%\lib;%MSC%\lib\sdk

SET HB_WITH_CURL=e:\hrbbld\curl\x86\include
SET HB_STATIC_CURL=yes

SET HB_WITH_OPENSSL=e:\hrbbld\openssl\x86\include
SET HB_WITH_ADS=e:\hrbbld\ads
SET HB_WITH_MYSQL=e:\hrbbld\mysql\include

SET HB_BUILD_DYN=no
SET HB_BUILD_CONTRIB_DYN=no

SET HB_BUILD_MODE=c

win-make clean install HB_USER_CFLAGS="-MD -MP -O1"

COPY %HB_WITH_MYSQL%\..\lib\x86\*.lib harbour\lib\win\msvc > NUL

PAUSE
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Horizon » Tue Jun 04, 2024 4:13 pm

Hi Antonio, Enrico,

I only wanted to use the latest versions of OpenSSL. I have no intention of recreating the Harbour.

I still use libeay32.lib, ssleay32.lib and their dlls.
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 Enrico Maria Giordano » Tue Jun 04, 2024 4:50 pm

Horizon wrote:Hi Antonio, Enrico,

I only wanted to use the latest versions of OpenSSL. I have no intention of recreating the Harbour.

I still use libeay32.lib, ssleay32.lib and their dlls.


They are older LIBs. Current Harbour builds contain all the required LIBs and DLLs.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Horizon » Tue Jun 04, 2024 7:25 pm



Hi Antonio,

I Have downloaded https://github.com/FiveTechSoft/harbour_and_xharbour_builds/blob/master/harbour_msvc2022_32_20240530.zip and compile it. I have not change my .mak file. It gives some errors.

Code: Select all  Expand view
LINK : warning LNK4286: symbol '_strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(hbfunchk.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 'xhb.lib(hbxml.obj)'
LINK : warning LNK4286: symbol '_strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbtip.lib(mime.obj)'
LINK : warning LNK4286: symbol '_strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(hbdbginf.obj)'
LINK : warning LNK4286: symbol '_strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(harboury.obj)'
LINK : warning LNK4217: symbol '_strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(cmdcheck.obj)' in function '_hb_compChkOptionLen'
LINK : warning LNK4286: symbol '_strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbcplr.lib(genc.obj)'
LINK : warning LNK4217: symbol '_strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbrtl.lib(hbjson.obj)' in function '__hb_jsonDecode'
LINK : warning LNK4286: symbol '_strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'hbvm.lib(hvmall.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 'hbcommon.lib(funcid.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 LNK4286: symbol '_fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'hbcplr.lib(compi18n.obj)'
LINK : warning LNK4286: symbol '_fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'hbcommon.lib(hbtrace.obj)'
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 'hbrtl.lib(errintlo.obj)' in function '_hb_errInternalRaw'
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 '_fclose' defined in 'libucrt.lib(fclose.obj)' is imported by 'hbcplr.lib(genhrb.obj)' in function '_hb_compGenPortObj'
LINK : warning LNK4286: symbol '___stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbcommon.lib(hbtrace.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 'hbrtl.lib(errintlo.obj)' in function '__vfprintf_l'
LINK : warning LNK4286: symbol '___stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'hbvm.lib(hvmall.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 '_srand' defined in 'libucrt.lib(rand.obj)' is imported by 'hbrtl.lib(arc4.obj)' in function '_arc4_seed_rand'
LINK : warning LNK4217: symbol '_rand' defined in 'libucrt.lib(rand.obj)' is imported by 'hbrtl.lib(arc4.obj)' in function '_arc4_seed_rand'
LINK : warning LNK4286: symbol '___acrt_iob_func' defined in 'libucrt.lib(_file.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 '_internal_malloc_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 'hbcommon.lib(hbtrace.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 LNK4217: symbol '__dclass' defined in 'libucrt.lib(nan.obj)' is imported by 'hbvm.lib(hvmall.obj)' in function '_hb_itemStrBuf'
LINK : warning LNK4286: symbol '__dclass' defined in 'libucrt.lib(nan.obj)' is imported by 'hbcommon.lib(hbprintf.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 LNK4286: symbol '_atoi' defined in 'libucrt.lib(atox.obj)' is imported by 'hbrdd.lib(wafunc.obj)'
LINK : warning LNK4286: symbol '_atoi' defined in 'libucrt.lib(atox.obj)' is imported by 'xhb.lib(hbxml.obj)'
LINK : warning LNK4286: symbol '_atoi' defined in 'libucrt.lib(atox.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol '_ceil' defined in 'libucrt.lib(ceil_pentium4.obj)' is imported by 'rddntx.lib(dbfntx1.obj)' in function '_hb_ntxSortNew'
LINK : warning LNK4217: symbol '_ceil' defined in 'libucrt.lib(ceil_pentium4.obj)' is imported by 'rddcdx.lib(dbfcdx1.obj)' in function '_hb_cdxOrderCreate'
LINK : warning LNK4286: symbol '_ceil' defined in 'libucrt.lib(ceil_pentium4.obj)' is imported by 'hbct.lib(ctmath2.obj)'
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 'hbcommon.lib(hbtrace.obj)'
LINK : warning LNK4286: symbol '_fflush' defined in 'libucrt.lib(fflush.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol '__dsign' defined in 'libucrt.lib(nan.obj)' is imported by 'hbcommon.lib(hbprintf.obj)' in function '_hb_vsnprintf'
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 '_fgetc' defined in 'libucrt.lib(fgetc.obj)' is imported by 'hbcplr.lib(hbmain.obj)' in function '_hb_compReadClpFile'
LINK : warning LNK4286: symbol '_fgetc' defined in 'libucrt.lib(fgetc.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 LNK4217: symbol '_fputc' defined in 'libucrt.lib(fputc.obj)' is imported by 'hbcplr.lib(gencc.obj)' in function '_hb_p_plus'
LINK : warning LNK4217: symbol '_fputc' defined in 'libucrt.lib(fputc.obj)' is imported by 'hbpp.lib(ppcore.obj)' in function '_hb_membufFree'
LINK : warning LNK4217: symbol '_fwrite' defined in 'libucrt.lib(fwrite.obj)' is imported by 'hbcplr.lib(genhrb.obj)' in function '_hb_compGenPortObj'
LINK : warning LNK4286: symbol '_fwrite' defined in 'libucrt.lib(fwrite.obj)' is imported by 'hbpp.lib(ppcore.obj)'
LINK : warning LNK4217: symbol '_isdigit' defined in 'libucrt.lib(_ctype.obj)' is imported by 'hbpcre.lib(pcrecomp.obj)' in function '_pcre_compile2'
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)'
LINK : warning LNK4217: symbol '_ispunct' defined in 'libucrt.lib(_ctype.obj)' is imported by 'xhb.lib(xhbis.obj)' in function '_HB_FUN_ISPUNCT'
LINK : warning LNK4217: symbol '_isprint' defined in 'libucrt.lib(_ctype.obj)' is imported by 'xhb.lib(xhbis.obj)' in function '_HB_FUN_ISPRINT'
LINK : warning LNK4217: symbol '_isgraph' defined in 'libucrt.lib(_ctype.obj)' is imported by 'xhb.lib(xhbis.obj)' in function '_HB_FUN_ISGRAPH'
LINK : warning LNK4217: symbol '_iscntrl' defined in 'libucrt.lib(_ctype.obj)' is imported by 'xhb.lib(xhbis.obj)' in function '_HB_FUN_ISCNTRL'
LINK : warning LNK4217: symbol '_fread' defined in 'libucrt.lib(fread.obj)' is imported by 'hbpp.lib(ppcore.obj)' in function '_hb_pp_pragmaStreamFile'
LINK : warning LNK4217: symbol '_fseek' defined in 'libucrt.lib(fseek.obj)' is imported by 'hbpp.lib(ppcore.obj)' in function '_hb_pp_pragmaStreamFile'
LINK : warning LNK4217: symbol '_ftell' defined in 'libucrt.lib(ftell.obj)' is imported by 'hbpp.lib(ppcore.obj)' in function '_hb_pp_pragmaStreamFile'
hbrtl.lib(run.obj) : error LNK2019: unresolved external symbol __imp___wsystem referenced in function _HB_FUN___RUN
hbrtl.lib(fstemp.obj) : error LNK2019: unresolved external symbol __imp__modf referenced in function _hb_fsCreateTempEx
hbvm.lib(hvmall.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
hbct.lib(ctmath2.obj) : error LNK2019: unresolved external symbol __imp__floor referenced in function _HB_FUN_FLOOR
hbpp.lib(ppcore.obj) : error LNK2019: unresolved external symbol __imp__fputs referenced in function _hb_pp_dumpEnd
IcraW.exe : fatal error LNK1120: 4 unresolved externals
Last edited by Horizon on Tue Jun 04, 2024 7:31 pm, edited 1 time in total.
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 Enrico Maria Giordano » Tue Jun 04, 2024 7:30 pm

Please post the compile batch you are using and a little sample PRG to reproduce the problem here.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby Antonio Linares » Tue Jun 04, 2024 7:35 pm

Hakan,

You have to add these flags in the HBP file:

-lucrt
-luxtheme

-ldflag=/NODEFAULTLIB:libucrt
-ldflag=/NODEFAULTLIB:msvcrt
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: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Horizon » Tue Jun 04, 2024 7:56 pm

Antonio Linares wrote:Hakan,

You have to add these flags in the HBP file:

-lucrt
-luxtheme

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


Can you please send buildh32.bat with needed changed.

These errors comes also compiling buildh32 tutor02.
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 » Tue Jun 04, 2024 9:28 pm

buildh32.bat
Code: Select all  Expand view
@ECHO OFF
CLS
ECHO ┌────────────────────────────────────────────────────────────────────────────┐
ECHO │ FiveWin for Harbour 24.04 (VS32bits) Apr. 2024  Harbour development power  │▄
ECHO │ (c) FiveTech 1993-2024 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 │█
ECHO └────────────────────────────────────────────────────────────────────────────┘█
ECHO   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

set oldpath=%Path%
set oldinclude=%include%
set oldlib=%lib%
set oldlibpath=%libpath%
@set current_dir=%cd%
setlocal
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
if "%FWDIR%" == "" set FWDIR=.\..
if "%HBDIR%" == "" set HBDIR=c:\harbour

ECHO Compiling...

@set fwh=%FWDIR%
@set hdir=%HBDIR%
@set hdirl=%hdir%\lib\win\msvc

@cd %current_dir%
%hdir%\bin\win\msvc\harbour %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
@type comp.log
@type warnings.log

cl.exe -nologo -c -O2  -W4 -wd4127 /I%hdir%\include %1.c
:ENDCOMPILE

IF EXIST %1.rc rc -r -d__FLAT__ %1
IF EXIST %1.rc IF NOT EXIST %1.res rc -r -d__FLAT__ %1

echo %1.obj  > msvc.tmp

echo %fwh%\lib\FiveH32.lib %fwh%\lib\FiveHC32.lib %fwh%\lib\libmysql32.lib  >> msvc.tmp
rem echo %fwh%\lib\drxlsx32.lib >> msvc.tmp
echo %fwh%\lib\xlsxlibhbmsvc.lib >> msvc.tmp
echo %fwh%\lib\hbhpdf32.lib >> msvc.tmp
echo %fwh%\lib\libhpdf32.lib >> msvc.tmp
echo %hdirl%\hbrtl.lib  >> msvc.tmp
echo %hdirl%\hbvm.lib  >> msvc.tmp
echo %hdirl%\gtgui.lib  >> msvc.tmp
echo %hdirl%\hblang.lib  >> msvc.tmp
echo %hdirl%\hbmacro.lib  >> msvc.tmp
echo %hdirl%\hbrdd.lib  >> msvc.tmp
echo %hdirl%\rddntx.lib  >> msvc.tmp
echo %hdirl%\rddcdx.lib  >> msvc.tmp
echo %hdirl%\rddfpt.lib  >> msvc.tmp
echo %hdirl%\hbsix.lib  >> msvc.tmp
echo %hdirl%\hbdebug.lib  >> msvc.tmp
echo %hdirl%\hbcommon.lib  >> msvc.tmp
echo %hdirl%\hbpp.lib  >> msvc.tmp
echo %hdirl%\hbcpage.lib  >> msvc.tmp
echo %hdirl%\hbwin.lib  >> msvc.tmp
echo %hdirl%\hbcplr.lib  >> msvc.tmp
echo %hdirl%\hbpcre.lib >> msvc.tmp
echo %hdirl%\hbct.lib  >> msvc.tmp
echo %hdirl%\xhb.lib  >> msvc.tmp
echo %hdirl%\png.lib  >> msvc.tmp
echo %hdirl%\hbzlib.lib  >> msvc.tmp
echo %hdirl%\hbziparc.lib >> msvc.tmp
echo %hdirl%\hbmzip.lib >> msvc.tmp
echo %hdirl%\minizip.lib >> msvc.tmp
echo %hdirl%\hbtip.lib >> msvc.tmp
echo %hdirl%\hbzebra.lib >> msvc.tmp

rem Uncomment these two lines to use Advantage RDD
rem echo %hdirl%\rddads.lib >> msvc.tmp
rem echo %hdirl%\ace32.lib >> msvc.tmp

echo kernel32.lib  >> msvc.tmp
echo user32.lib    >> msvc.tmp
echo gdi32.lib     >> msvc.tmp
echo winspool.lib  >> msvc.tmp
echo comctl32.lib  >> msvc.tmp
echo comdlg32.lib  >> msvc.tmp
echo advapi32.lib  >> msvc.tmp
echo shell32.lib   >> msvc.tmp
echo ole32.lib     >> msvc.tmp
echo oleaut32.lib  >> msvc.tmp
echo uuid.lib      >> msvc.tmp
echo odbc32.lib    >> msvc.tmp
echo odbccp32.lib  >> msvc.tmp
echo iphlpapi.lib  >> msvc.tmp
echo mpr.lib       >> msvc.tmp
echo version.lib   >> msvc.tmp
echo wsock32.lib   >> msvc.tmp
echo msimg32.lib   >> msvc.tmp
echo oledlg.lib    >> msvc.tmp
echo psapi.lib     >> msvc.tmp
echo gdiplus.lib   >> msvc.tmp
echo winmm.lib     >> msvc.tmp
echo vfw32.lib     >> msvc.tmp
echo runtimeobject.lib >> msvc.tmp
echo ws2_32.lib    >> msvc.tmp
echo shlwapi.lib   >> msvc.tmp
echo strmiids.lib  >> msvc.tmp
echo ucrt.lib      >> msvc.tmp
echo uxtheme.lib   >> msvc.tmp

IF EXIST %1.res echo %1.res >> msvc.tmp

link @msvc.tmp /nologo /subsystem:windows /NODEFAULTLIB:libucrt /NODEFAULTLIB:msvcrt

IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
@set include=%oldinclude%
@set lib=%oldlib%
@set libpath=%oldlibpath%
@set oldpath=%Path%
@set oldinclude=""
@set oldlib=""
@set oldlibpath=""
@set Path=%oldpath%
endlocal
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c
@del msvc.tmp

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

:LINKERROR
ECHO * Linking errors *
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Build [Program]     {-- No especifiques la extensi?n PRG
ECHO                                {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT
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: Build your FWH app using hbmk2.exe and MSVC 32&64

Postby Horizon » Wed Jun 05, 2024 8:31 am

Hi Antonio,

There is no problem compiling Tutor02.prg with your Buildh32.bat in fwh/samples.

I made the changes you made in buildh32.bat to my own .mak file. All errors disappeared except for one error.

Code: Select all  Expand view
SKeyLi32.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __iob referenced in function _OPENSSL_showfatal
IcraW.exe : fatal error LNK1120: 1 unresolved externals


When I go back to the old version of Harbor (Harbour 3.2.0dev (r2304211101)), this error does not appear and the Icraw.exe is created.

When I try to compile it with hbmk2 using latest Harbor (the link you gave), the following error occurs.
Code: Select all  Expand view
hbmk2: Compiling Harbour sources...
Harbour 3.2.0dev (r2405130039)
Copyright (c) 1999-2021, https://harbour.github.io/
Compiling 'Master.prg'...
Lines 11024, Functions/Procedures 24
Generating C source output to 'Obj\Master.c'... Done.
hbmk2: Compiling...
Master.c
hbmk2: Linking... IcraW.exe
hbfoxpro.lib(dbfunc.obj) : warning LNK4006: _HB_FUN_FSIZE already defined in FiveH32.lib(FILENAME.ob
n ignored
SKeyLi32.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __iob referenced in function
IcraW.exe : fatal error LNK1120: 1 unresolved externals
hbmk2[IcraW]: Error: Running linker. 1120
link.exe @C:\Users\Hakan\AppData\Local\Temp\vu4v0q.lnk


My main goal is to compile the program with Hbmk2. Once I do this, I want to try 64 bit compilation next.

How can I solve this error?
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 Enrico Maria Giordano » Wed Jun 05, 2024 8:35 am

Horizon wrote:
Code: Select all  Expand view
SKeyLi32.lib(cryptlib.obj) : error LNK2019: unresolved external symbol __iob referenced in function _OPENSSL_showfatal
IcraW.exe : fatal error LNK1120: 1 unresolved externals


That symbol isn't there in any of the OpenSSL libs, so you are using an older or wrong lib.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 77 guests