Page 1 of 1

Link Errors

PostPosted: Tue Nov 08, 2016 6:58 am
by MichaelMo
I'm upgrading from a very old copy of Fivewin/Harbour to the October 16th version. The application seems to compile just fine in Harbour 3.2, the new version of FWH and BCC7, but I'm getting the following link error when I try to compile. What am I missing?


Turbo Incremental Link 6.70 Copyright (c) 1997-2014 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_HB_GETFILESINZIP' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN_HB_UNZIPOPEN' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN_HB_UNZIPFILEFIRST' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN_HB_UNZIPFILEINFO' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN_HB_UNZIPFILEOPEN' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN_HB_UNZIPFILEREAD' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN_HB_UNZIPFILECLOSE' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN_HB_UNZIPFILENEXT' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN_HB_UNZIPCLOSE' referenced from C:\FWH\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external 'SHCreateDirectoryExA' referenced from C:\FWH\LIB\FIVEHC.LIB|MKDIR
Error: Unresolved external 'SHCreateDirectoryExW' referenced from C:\FWH\LIB\FIVEHC.LIB|MKDIR
Error: Unresolved external '_HB_FUN_CURDRIVE' referenced from C:\32BIT\OCW\RELEASE\SYSTEM.OBJ
Error: Unable to perform link

Re: Link Errors

PostPosted: Tue Nov 08, 2016 7:14 am
by cnavarro

Re: Link Errors

PostPosted: Tue Nov 08, 2016 9:27 am
by nageswaragunupudi
Simple Thumb Rule:

Please see \fwh\samples\buildh.bat and buildx.bat.

If you are building application with Harbour, include in your link script all the libs listed in buildh.bat and if you are using xHarbour, all the libs listed in buildx.bat.

You may keep checking for any changes in these two bat files while upgrading to any new version.

Re: Link Errors

PostPosted: Thu Nov 10, 2016 3:00 am
by MichaelMo
Thanks for everyone's help by the way. Sorry for not responding sooner, but I've been a bit preoccupied. I went through the buildh file list of various libs and I added a number of missing libs for Fivewin, Harbour, and Borland. That took care of 12 of the 13 missing references, but I'm still getting one unresolved reference:

Error: Unresolved external '_HB_FUN_CURDRIVE' referenced from C:\32BIT\OCW\DEBUG\SYSTEM.OBJ

I believe it's coming from this Harbour function call:

GetCurrentDirectory()

Any idea why it still won't find that function?

Re: Link Errors

PostPosted: Thu Nov 10, 2016 4:14 am
by MichaelMo
Well, apparently addiing hbxpp.lib to the list of harbour libs took care of that GetCurrentDirectory problem, but......

The application now compiles just fine, but when I try to open up a TDatabase file, I'm getting a Warning box that pops up that says:

Warning:

Truename not finished

I then get an error base/44 assigned value is wrong class: TDatabase:cFile

I've never seen anything like that before. What the heck?

Re: Link Errors

PostPosted: Thu Nov 10, 2016 4:31 am
by nageswaragunupudi
TrueName() is a function.

TrueName( cRelativePath ) --> cFullPath

Example:
if current directory is c:\fwh\samples, then

? TrueName( "customer.dbf" ) // --> "c:\fwh\samples\customer.dbf"

This function is also used in TDatabase like this

Code: Select all  Expand view
     ::cFile     = TrueName( ::cFile )

This works perfectly.

Re: Link Errors

PostPosted: Thu Nov 10, 2016 4:42 am
by nageswaragunupudi
MichaelMo wrote:Thanks for everyone's help by the way. Sorry for not responding sooner, but I've been a bit preoccupied. I went through the buildh file list of various libs and I added a number of missing libs for Fivewin, Harbour, and Borland. That took care of 12 of the 13 missing references, but I'm still getting one unresolved reference:

Error: Unresolved external '_HB_FUN_CURDRIVE' referenced from C:\32BIT\OCW\DEBUG\SYSTEM.OBJ

I believe it's coming from this Harbour function call:

GetCurrentDirectory()

Any idea why it still won't find that function?


This is my opinion:

1) C:\32BIT\OCW\DEBUG\SYSTEM.OBJ is not a module from FWH libraries. May be you are using some additional library or prg file.
2) FWH libraires never used the function GetCurrentDirectory(). This usage must be from an external library or prg file you have linked.
3) CURDRIVE() is available in xHarbour but not in Harbour. In Harbour it is HB_CURDRIVE(). Probably use are linking an external program by name "system.prg", which was written for xHarbour using the functions GetCurrentDirectory and/or CURDRIVE.

Please remove the new lib added and revise the external program included in the link script.

Re: Link Errors

PostPosted: Thu Nov 10, 2016 4:59 am
by MichaelMo
nageswaragunupudi wrote:TrueName() is a function.


If so, it's one that I'm never calling directly. The offending code looks like this:

use ars_data new

if (!neterr())

set index to ars_com, ars_acc
DATABASE oDbfParent

endif

Re: Link Errors

PostPosted: Thu Nov 10, 2016 5:06 am
by nageswaragunupudi
There is nothing wrong with your usage or with TDatabase class.
Please go through my post above in detail

Re: Link Errors

PostPosted: Thu Nov 10, 2016 8:42 am
by Antonio Linares