From 43176e343299c0f408e8fa5bd47da1163ecb1629 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 9 May 2019 19:23:53 +0000
Subject: [PATCH] Work-around for issue with the old implib version: Borland
 Implib Version 3.0.22 Copyright (c) 1991, 2000 Inprise Corporation and
 MSVC-generated DLLs with exported functions using _cdecl calling convention
 ... sometimes or with some verisons of some DLLs, implib won't add the
 underscore prefix to the exported function name which caused the build error:
 Error: Unresolved external '_total_users' ...

Using coff2omf instead to convert the MSVC-generated import library (sbbs.lib)
to the Borland/OMF flavor works, however. I'd seen this issue before but it
went away when the number of symbols in the source DLL changes. Newer versions
of implib appear to *not* have this issue so when we upgrade to a newer
C++Builder, this work-around will no longer be necessary.
---
 src/sbbs3/ctrl/makelibs.bat | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/sbbs3/ctrl/makelibs.bat b/src/sbbs3/ctrl/makelibs.bat
index 492ffacbe2..2435cdae92 100755
--- a/src/sbbs3/ctrl/makelibs.bat
+++ b/src/sbbs3/ctrl/makelibs.bat
@@ -8,7 +8,8 @@ if '%1'=='' goto implib
 set dllsrc=%1
 :implib
 echo Creating import libraries from %dllsrc%
-implib -a sbbs.lib 	%dllsrc%\sbbs.dll
+rem implib -a sbbs.lib 	%dllsrc%\sbbs.dll
+coff2omf %dllsrc%\sbbs.lib sbbs.lib
 implib -a mailsrvr.lib 	%dllsrc%\mailsrvr.dll
 implib -a ftpsrvr.lib 	%dllsrc%\ftpsrvr.dll
 implib -a websrvr.lib 	%dllsrc%\websrvr.dll
-- 
GitLab