Need Help Building HBWIN.lib with MSVC 2019

259 views
Skip to first unread message

jast...@gmail.com

unread,
Jun 29, 2023, 9:14:46 PM6/29/23
to Harbour Users
Hi,

A VFP .DLL that we have been using for 15+ years stopped working on all office computers today.  I need to rebuild it in Harbour compiling it with MSVC 2019.  I have adjusted the VFP code but cannot compile the .DLL as I get an error message: LNK1181: cannot open input file 'hbwin.lib'

I've done a new install of Harbour but cannot figure out how to build the HBWIN.lib library.  There was no win-make.exe file from the 3.2 install. So, I pulled it from github.com/harbour/core but I am unclear how to call it to build the HBWIN.LIB.  I have also seen references to make.hb but I cannot find that file in the install either.

Thanks in advance for any and all suggestions.

Jeff
Message has been deleted
Message has been deleted
Message has been deleted

jast...@gmail.com

unread,
Jun 29, 2023, 10:18:15 PM6/29/23
to Harbour Users
Since I saw what looked like n HBWIN.lib in the mingw32 directory, I tried compiling with mingw32 but was unsuccessful.  Attached is the prg that I'm trying build into a .dll and the files that I'm using to compile with.

fp_import.prg
fp_import.hbp

Auge & Ohr

unread,
Jun 30, 2023, 2:30:53 AM6/30/23
to Harbour Users
hi,

HBWIN.LIB is Part of harbour but depend on Compiler

 Verzeichnis von C:\harbour64\lib\win
25.06.2022  09:59    <DIR>          bcc
27.06.2022  10:23    <DIR>          mingw
30.07.2022  05:54    <DIR>          mingw64
25.06.2022  09:48    <DIR>          msvc
25.06.2022  11:23    <DIR>          msvc64

you can NOT use MinGW or BCC for MSVC
---
about your *.HBC

-hblib    
-Ic:\fwh64\include
fp_import2.prg
-Lc:\fwh64\lib
hbolesrv.hbc
hbnf.hbc
xhb.hbc

jast...@gmail.com

unread,
Jun 30, 2023, 8:55:35 AM6/30/23
to Harbour Users
Hi Auge,

Thanks for the reply.   I guess my issue is that under  C:\hb32\lib\win, I only have a mingw subdirectory and no msvc directory.  So, I guess I did not take the correct install package.  I will hunt for a different one.  However, based on the documentation, it seemed like there was a way to generate the contrib lib files after installation.  Am I misunderstanding the documentation?

Regards,

Jeff

jast...@gmail.com

unread,
Jun 30, 2023, 9:06:22 AM6/30/23
to Harbour Users
I also should have mentioned that the .dll that I am creating needs to be 32bits rather than 64.  I installed Harbour version 3.2.  Should I have installed a different version of Harbour and, if so, from where?

jast...@gmail.com

unread,
Jun 30, 2023, 11:31:26 AM6/30/23
to Harbour Users
I removed 3.2 and installed 3.0 which has all of the msvc libraries.  Now my only issues are that I am getting unresolved externals:
     rddcdx.lib(dbfcdx1.obj) : error LNK2001: unresolved external symbol ___iob_func
     hbcplr.lib(hbcomp.obj) : error LNK2001: unresolved external symbol ___iob_func
     hbpp.lib(ppcore.obj) : error LNK2001: unresolved external symbol ___iob_func
     hbpp.lib(ppcore.obj) : error LNK2001: unresolved external symbol _printf

I am compiling with MSVC 2019

All suggestions would be appreciated

Auge & Ohr

unread,
Jun 30, 2023, 6:21:54 PM6/30/23
to Harbour Users
hi,

i wonder hat People use harbour without Constribution / Distribution.
for a normal App you need "Controls" ...

but not all Constribution / Distribution. work with MSVC, only Fivewin as i know
p.s. it doesn´t Matter if 32 Bit or 64 Bit LIB, the Way is the same to build LIB

---

as i understand harbour need a "Import" LIB for *.DLL
i have just build it for LibPQ.DLL / hbPgSQL.LIB 64 Bit

MakeFWLIB.BAT

call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
c:\harbour64\bin\win\msvc64\hbmk2 hbpgsql.hbp -comp=msvc64

Jimmy

jast...@gmail.com

unread,
Jul 1, 2023, 9:38:55 AM7/1/23
to Harbour Users
Hi Jimmy,
Thanks for your suggestion.  Yesterday I was searching for a Harbour build with MSVC libraries and came across a posting by Antonio Linares pointing out the GitHub site he created that has all varieties of Harbour and xHarbour builds: https://github.com/FiveTechSoft/harbour_and_xharbour_builds

So, https://github.com/FiveTechSoft/harbour_and_xharbour_builds/blob/master/harbour_msvc32_20190508.zip contained exactly what I needed.  But, your approach would have gotten me to where I needed to be, so thanks again.

Jeff

Paul Smith

unread,
Jul 3, 2023, 2:42:44 AM7/3/23
to Harbour Users
Hi Jeff

As you found win-make.exe is in the http://github.com/harbour/core   package.
To make your own harbour install from source code you need to click on the green code button and download it all as a zip file.
Once extracted you can make your own harbour using your compiler of choice using win-make.exe AFTER you have set the right environment for your compiler.
For example if you want to make  a 32 bit version for MSVC and have the compiler in a c:\vc folder you need to run the following commands at the command prompt

set INCLUDE=C:\VC\INCLUDE;C:\VC\Windows Kits\10\include\10.0.10240.0\ucrt;C:\VC\Windows Kits\8.1\include\shared;C:\VC\Windows Kits\8.1\include\um;C:\VC\Windows Kits\8.1\include\winrt;

set LIB=C:\VC\LIB;C:\VC\Windows Kits\10\lib\10.0.10240.0\ucrt\x86;C:\VC\Windows Kits\8.1\lib\winv6.3\um\x86;

Path=C:\VC\MSBuild\14.0\bin;C:\VC\BIN;C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319;C:\WINDOWS\Microsoft.NET\Framework\;C:\VC\Windows Kits\8.1\bin\x86;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;

Then win-make.exe will make all the files in \~\bin\win\msvc folder.
Likewise you must set the path to the compiler of choice when making your application.
Are you aware that applications made with MSVC have a reputation for secretly sending telemetry data back to microsoft?


Does your VFP .DLL only work with your application if it's compiled with MSVC and not with MINGW?

Cheers
Paul






matt johnson

unread,
Jul 3, 2023, 1:41:38 PM7/3/23
to harbou...@googlegroups.com

Maybe Foxpro failed because of a Windows update? 
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/be6e2dc3-1bb7-4ebf-b5eb-cce32453a886n%40googlegroups.com.

theos theos

unread,
Jul 3, 2023, 8:49:23 PM7/3/23
to Harbour Users
Espero que sirva de guía, hace años compile los fuentes Harbour del sitio oficial
con Visual Studio C++ 2010 Express 32 bit, en Windows 10, tal vez tengas problemas con
las librerías de contribución, para tu caso no los incluyas (coméntalos con REM).

abre consola de windows y busca algo similar a vcvarsall.bat , para que VS2019 tome el control
"%C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"

@echo off

REM Harbour-32bit with VS2010
REM -------------------------
set PATH=C:\Harbour\library\curl-3\bin;C:\Harbour\library\curl-3\lib;%PATH%
set PATH=C:\Harbour\library\openssl-3\x86\bin;C:\Harbour\library\openssl-3\x86\lib;%PATH%
set PATH=C:\Harbour\core-master\bin\win\msvc;%PATH%
CALL "%C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"

REM SET HB_INSTALL_PREFIX=C:\HB32

SET HB_WITH_FREEIMAGE=C:\HARBOUR\HBLIB\FreeImage\Dist
SET HB_WITH_OCILIB=C:\HARBOUR\HBLIB\ocilib\include

SET HB_WITH_OPENSSL=C:\Harbour\library\openssl-3\x86\include
SET HB_WITH_CURL=C:\HARBOUR\HBLIB\curl-3\include

SET HB_STATIC_OPENSSL=yes
SET HB_STATIC_CURL=yes
set HB_COMPILER=msvc

cd C:\Harbour\core-master
"C:\WINDOWS\system32\cmd.exe" /k win-make  

Reply all
Reply to author
Forward
0 new messages