Error using -Shared

158 views
Skip to first unread message

Rossine

unread,
Oct 11, 2010, 11:25:06 AM10/11/10
to Harbour Developers
Hello,

Using the configuration below in my. Hbc:

[HBC]

{win}gt=gtgui

mt=yes

libs=hbrtl
libs=hbole
libs=odbc32
libs=hbxml
libs=shell32
libs=socket
libs=hbxpp
libs=ws2_32
libs=hbfimage
libs=hbwin
libs=png
libs=freeimage
libs=hbcomm
libs=xhb
libs=ace32

[ENDHBC]

I'm trying to generate my. Exe with the "-shared" and it occurs to me
the errors below:

[ERRORS]
Harbour 2.1.0beta2 (Rev. 15597)
Copyright (c) 1999-2010, http://harbour-project.org/
Compiling 'caller.prg'...

Lines 49, Functions/Procedures 1
Generating C source output to 'C:\TMP\hbmk_5drjog.dir\caller.c'...
Done.
C:\TMP\hbmk_5drjog.dir\caller.c:
C:\TMP\hbmk_eekdo2.c:
Turbo Incremental Link 5.69 Copyright (c) 1997-2005 Borland
Error: Unresolved external '_hb_clsCreate' referenced from C:\HRB_BCC
\LIB\HBRTL.LIB|errapi
Error: Unresolved external '_hb_clsAdd' referenced from C:\HRB_BCC\LIB
\HBRTL.LIB|errapi
Error: Unresolved external '_hb_clsAssociate' referenced from C:
\HRB_BCC\LIB\HBRTL.LIB|errapi
Error: Unresolved external '_hb_cmdargNum' referenced from C:\HRB_BCC
\LIB\HBRTL.LIB|console
Error: Unresolved external '_hb_stackDirBuffer' referenced from C:
\HRB_BCC\LIB\HBRTL.LIB|filesys
Error: Unresolved external '_hb_stackIOErrors' referenced from C:
\HRB_BCC\LIB\HBRTL.LIB|fserr
Error: Unresolved external '_hb_stackSetGT' referenced from C:\HRB_BCC
\LIB\HBRTL.LIB|hbgtcore
Error: Unresolved external '_hb_stackGetGT' referenced from C:\HRB_BCC
\LIB\HBRTL.LIB|hbgtcore
Error: Unresolved external '_hb_cmdargString' referenced from C:
\HRB_BCC\LIB\HBRTL.LIB|hbgtcore
Error: Unresolved external '_hb_cmdargCheck' referenced from C:\HRB_BCC
\LIB\HBRTL.LIB|console
Error: Unresolved external '_hb_stackTotalItems' referenced from C:
\HRB_BCC\LIB\HBRTL.LIB|errintlo
Error: Unresolved external '_hb_winmainArgInit' referenced from C:
\HRB_BCC\LIB\HBMAINWIN.LIB|mainwin
Error: Unresolved external '_hb_szAscii' referenced from C:\HRB_BCC\LIB
\HBRTL.LIB|chrasc

[ENDERRORS]

What can be ?

Best Regards,

Rossine.

Massimo Belgrano

unread,
Oct 11, 2010, 11:57:19 AM10/11/10
to Harbour Developers
afaik hb_clsCreate are contained in lib hbvm
> Copyright (c) 1999-2010,http://harbour-project.org/

druzus

unread,
Oct 11, 2010, 1:26:00 PM10/11/10
to Harbour Developers
On 11 Paź, 17:25, Rossine <rossin...@gmail.com> wrote:

Hi,

> Using the configuration below in my. Hbc:
> [HBC]
> {win}gt=gtgui
> mt=yes
> libs=hbrtl
^^^^^^^^^^^
This is the source of your problems.
_NEVER_ add any core libraries manually.
They are automatically added by hbmk2 if necessary.
In this case you are trying to create some binaries
where hbrtl code is linked multiple times - one copy
from hbrtl library and second one from harbour shared
library.

best regards,
Przemek

Rossine

unread,
Oct 11, 2010, 2:39:25 PM10/11/10
to Harbour Developers
Hi Przemek,

> This is the source of your problems.
> _NEVER_ add any core libraries manually.
> They are automatically added by hbmk2 if necessary.
> In this case you are trying to create some binaries
> where hbrtl code is linked multiple times - one copy
> from hbrtl library and second one from harbour shared
> library.

OK. I took out all references within the libs and left my hbc hbmk2 do
this for me, but now these errors occurs:

Error: Unresolved external '_HB_FUN_GETCPU' referenced from C:\TMP
\LIBTESTE.LIB|errorsys
Error: Unresolved external '_HB_FUN_GETCPUSPEED' referenced from C:\TMP
\LIBTESTE.LIB|errorsys
Error: Unresolved external '_HB_FUN_NETIO_CONNECT' referenced from C:
\TMP\LIBTESTE.LIB|errorsys
Error: Unresolved external '_HB_FUN_HB_DUMPVAR' referenced from C:
\LIB2\LIB\LIB2.LIB|sl_tostring
Error: Unresolved external '_HB_FUN_NETIO_DISCONNECT' referenced from
C:\TMP\LIBTESTE.LIB|sqlhrb
Error: Unresolved external '_HB_FUN_ADSENABLEENCRYPTION' referenced
from C:\TMP\LIBTESTE.LIB|sqlhrb
Error: Unresolved external '_HB_FUN_ADSSETSERVERTYPE' referenced from
C:\TMP\HBMK_PUM9U8.DIR\LIBTESTEM.OBJ
Error: Unresolved external '_HB_FUN_ADSSETFILETYPE' referenced from C:
\TMP\HBMK_PUM9U8.DIR\LIBTESTEM.OBJ
Error: Unresolved external '_HB_FUN_ADSSETDELETED' referenced from C:
\TMP\HBMK_PUM9U8.DIR\LIBTESTEM.OBJ

My compile line is this:

hbmk2 -trace -info -n -gc3 -shared myprog myprog.hbm myprog.hbc 1>
comp1.log 2> comp2.log

Best Regards,

Rossine.

Alex Strickland

unread,
Oct 11, 2010, 3:36:47 PM10/11/10
to harbou...@googlegroups.com
On 2010/10/11 08:39 PM, Rossine wrote:
> Hi Przemek,
>
>> This is the source of your problems.
>> _NEVER_ add any core libraries manually.
>> They are automatically added by hbmk2 if necessary.
>> In this case you are trying to create some binaries
>> where hbrtl code is linked multiple times - one copy
>> from hbrtl library and second one from harbour shared
>> library.
>

The key word you are missing there is core. You'll have to put some back
now!

--
Alex

Message has been deleted

Rossine

unread,
Oct 11, 2010, 4:29:26 PM10/11/10
to Harbour Developers
Hello Alex,

> The key word you are missing there is core. You'll have to put some back
> now!

Ok, I returned a few lib's I now I can generate my .EXE, but the
application does not run, he throws me a GPF error recorded in
hb_out.log. See:

Application Internal Error - C:\tmp\myprogram.exe
Terminated at: 2010.10.11 17:06:32
Unrecoverable error 9998: Harbour terminal (GT) initialization failure
------------------------------------------------------------------------
Application Internal Error - C:\tmp\myprogram.exe
Terminated at: 2010.10.11 17:07:33
Unrecoverable error 9998: Harbour terminal (GT) initialization failure
------------------------------------------------------------------------

This is my .hbc

cflags=-I%HB_INC_PGSQL%

{win}gt=gtgui

mt=yes

libs=\qi\win\objetos\geral\mylib.lib

{win}incpaths=c:\minigui\include
{win}libpaths=c:\minigui\lib

# core
{win}libs=minigui

{bcc}libs=dll calldll
{bcc}libs=hbmisc

libs=cputype propgrid propsheet tsbrowse WinReport
libs=hbmemio hbnetio hbtip hbct hbwin
libs=hbole hbprinter miniprint TMsAgent harupdf odbc32 hbxml shell32
socket hbxpp ws2_32 hbrtl
libs=freeimage hbfimage
libs=hbcomm
libs=xhb
libs=ace32 rddads
libs=hbvm hbvmmt hbcommon hbmacro

# system
{win}libs=vfw32

libs=c:\bcc582\Lib\psdk\iphlpapi.lib
libs=c:\bcc582\lib\psdk\msimg32.lib

Best Regards,

Rossine.

Viktor Szakáts

unread,
Oct 13, 2010, 12:39:31 PM10/13/10
to harbou...@googlegroups.com
Hi,

> libs=hbvm hbvmmt hbcommon hbmacro

Regardless of your problem, make sure to remove these
and never readd any Harbour core libs to hbmk2. It will only
screw things.

Viktor

Rossine

unread,
Oct 13, 2010, 1:29:19 PM10/13/10
to Harbour Developers
Hi Viktor,
Ok, I took these lib's in my script:

#libs=hbrtl
#libs=hbvm
#libs=hbvmmt
#libs=hbcommon
#libs=hbmacro

...and now I am seeing these errors in compiling:

Error: Unresolved external '_hb_winmainArgInit' referenced from C:
\HRB_BCC\LIB\HBMAINWIN.LIB|mainwin
Error: Unresolved external '_hb_macroCompile' referenced from C:
\HRB_BCC\LIB\HBRDD.LIB|workarea
Error: Unresolved external '_hb_stackRDD' referenced from C:\HRB_BCC
\LIB\HBRDD.LIB|wacore
Error: Unresolved external '_hb_stackTopOffset' referenced from C:
\HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
Error: Unresolved external '_hb_stackBaseOffset' referenced from C:
\HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
Error: Unresolved external '_hb_stackItem' referenced from C:\HRB_BCC
\LIB\XHB.LIB|xhbenum
Error: Unresolved external '_hb_stackSetActionRequest' referenced from
C:\HRB_BCC\LIB\HBOLE.LIB|w32ole
Error: Unresolved external '_hb_szAscii' referenced from C:\HRB_BCC\LIB
\HBPP.LIB|ppcore

Remembering that these errors only occur when I use "-shared" in my
script because I'm trying to use DLL created in harbour in my system.

Any suggestions on the errors ?

Best regards,

Rossine.

Viktor Szakáts

unread,
Oct 13, 2010, 2:00:43 PM10/13/10
to harbou...@googlegroups.com
> Error: Unresolved external '_hb_winmainArgInit' referenced from C:
> \HRB_BCC\LIB\HBMAINWIN.LIB|mainwin
> Error: Unresolved external '_hb_macroCompile' referenced from C:
> \HRB_BCC\LIB\HBRDD.LIB|workarea
> Error: Unresolved external '_hb_stackRDD' referenced from C:\HRB_BCC
> \LIB\HBRDD.LIB|wacore
> Error: Unresolved external '_hb_stackTopOffset' referenced from C:
> \HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
> Error: Unresolved external '_hb_stackBaseOffset' referenced from C:
> \HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
> Error: Unresolved external '_hb_stackItem' referenced from C:\HRB_BCC
> \LIB\XHB.LIB|xhbenum
> Error: Unresolved external '_hb_stackSetActionRequest' referenced from
> C:\HRB_BCC\LIB\HBOLE.LIB|w32ole
> Error: Unresolved external '_hb_szAscii' referenced from C:\HRB_BCC\LIB
> \HBPP.LIB|ppcore

These are symbols which are not exported from harbour dll.

Either they should be fixed to get exported, or code be fixed
to not use these internal symbols.

Viktor

Rossine

unread,
Oct 15, 2010, 10:36:07 AM10/15/10
to Harbour Developers
Hello All,

Any news on these errors using "-shared" ?

Error: Unresolved external '_hb_winmainArgInit' referenced from C:
\HRB_BCC\LIB\HBMAINWIN.LIB|mainwin
Error: Unresolved external '_hb_macroCompile' referenced from C:
\HRB_BCC\LIB\HBRDD.LIB|workarea
Error: Unresolved external '_hb_stackRDD' referenced from C:\HRB_BCC
\LIB\HBRDD.LIB|wacore
Error: Unresolved external '_hb_stackTopOffset' referenced from C:
\HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
Error: Unresolved external '_hb_stackBaseOffset' referenced from C:
\HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
Error: Unresolved external '_hb_stackItem' referenced from C:\HRB_BCC
\LIB\XHB.LIB|xhbenum
Error: Unresolved external '_hb_stackSetActionRequest' referenced from
C:\HRB_BCC\LIB\HBOLE.LIB|w32ole
Error: Unresolved external '_hb_szAscii' referenced from C:\HRB_BCC\LIB
\HBPP.LIB|ppcore
Error: Unable to perform link

Best Regards,

Rossine.

Przemysław Czerpak

unread,
Oct 15, 2010, 10:42:58 AM10/15/10
to harbou...@googlegroups.com
On Fri, 15 Oct 2010, Rossine wrote:
> Hello All,
> Any news on these errors using "-shared" ?

You still link manually core libraries so
I have to ignore your messages.

best regards,
Przemek

Rossine

unread,
Oct 15, 2010, 1:34:46 PM10/15/10
to Harbour Developers
Hello Przemek,

> You still link manually core libraries so

OK, but if I for example delete this definition of mine .hbc:

#libs=xhb

... occurs to me the errors below.

Error: Unresolved external '_hb_winmainArgInit' referenced from C:
\HRB_BCC\LIB\HBMAINWIN.LIB|mainwin
Error: Unresolved external '_hb_macroCompile' referenced from C:
\HRB_BCC\LIB\HBRDD.LIB|workarea
Error: Unresolved external '_hb_stackRDD' referenced from C:\HRB_BCC
\LIB\HBRDD.LIB|wacore
Error: Unresolved external '_hb_stackTopOffset' referenced from C:
\HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
Error: Unresolved external '_hb_stackBaseOffset' referenced from C:
\HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
Error: Unresolved external '_HB_FUN_ISLOCKED' referenced from C:\SQLLIB
\LIB\SQLLIB.LIB|sl_wabase
Error: Unresolved external '_HB_FUN_HB_DUMPVAR' referenced from C:
\SQLLIB\LIB\SQLLIB.LIB|sl_tostring
Error: Unresolved external '_HB_FUN_HB_ENUMINDEX' referenced from C:
\TMP\HBMK_TBABE2.DIR\QILIBM.OBJ
Error: Unresolved external '_hb_stackSetActionRequest' referenced from
C:\HRB_BCC\LIB\HBOLE.LIB|w32ole
Error: Unresolved external '_HB_FUN_HSETCASEMATCH' referenced from C:
\QI\WIN\OBJETOS\GERAL\QILIB.LIB|GERIMP
Error: Unresolved external '_HB_FUN_HASH' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETINIT' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETCONNECT' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETERRORCODE' referenced from C:
\TMP\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETERRORDESC' referenced from C:
\TMP\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETSETTIMEOUT' referenced from C:
\TMP\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETRECVENDBLOCK' referenced from
C:\TMP\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETSENDALL' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETCLOSE' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETDESTROY' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETCLEANUP' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETRECV' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_HB_CRYPT' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_HB_DECRYPT' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_FILESTATS' referenced from C:\TMP
\HBMK_TBABE2.DIR\QISTART.OBJ
Error: Unresolved external '_hb_szAscii' referenced from C:\HRB_BCC\LIB
\HBPP.LIB|ppcore

Best regards,

Rossine.

Przemysław Czerpak

unread,
Oct 15, 2010, 2:09:32 PM10/15/10
to harbou...@googlegroups.com
On Fri, 15 Oct 2010, Rossine wrote:

Hi,

> > You still link manually core libraries so
> OK, but if I for example delete this definition of mine .hbc:
> #libs=xhb

XHB is not core library. It should be included so
above modification is wrong.

> ... occurs to me the errors below.
> Error: Unresolved external '_hb_winmainArgInit' referenced from C:
> \HRB_BCC\LIB\HBMAINWIN.LIB|mainwin

HBMAINWIN.LIB is core library, should not be included.

> Error: Unresolved external '_hb_macroCompile' referenced from C:
> \HRB_BCC\LIB\HBRDD.LIB|workarea

HBRDD.LIB is core library, should not be included.

> Error: Unresolved external '_hb_stackRDD' referenced from C:\HRB_BCC
> \LIB\HBRDD.LIB|wacore
> Error: Unresolved external '_hb_stackTopOffset' referenced from C:
> \HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
> Error: Unresolved external '_hb_stackBaseOffset' referenced from C:
> \HRB_BCC\LIB\HBUSRRDD.LIB|usrrdd
> Error: Unresolved external '_HB_FUN_ISLOCKED' referenced from C:\SQLLIB

HBUSRRDD.LIB is core library, should not be included.

> \LIB\SQLLIB.LIB|sl_wabase
> Error: Unresolved external '_HB_FUN_HB_DUMPVAR' referenced from C:
> \SQLLIB\LIB\SQLLIB.LIB|sl_tostring
> Error: Unresolved external '_HB_FUN_HB_ENUMINDEX' referenced from C:

I do not know SQLLIB.LIB.
HB_DUMPVAR() and HB_ENUMINDEX() are not Harbour functions.
These are xHarbour functions we support in XHB library but
it suggests that this library was written for xHarbour.
It' even possible that it was compiled with xHarbour header
files or by xHarbour compiler so it will not work correctly
even if you link your application.

> \TMP\HBMK_TBABE2.DIR\QILIBM.OBJ
> Error: Unresolved external '_hb_stackSetActionRequest' referenced from

I do not know what it QILIBM.OBJ and why it tries to access
hb_stackSetActionRequest(). This is not public function.
hb_vmRequest*() can be used instead.

> C:\HRB_BCC\LIB\HBOLE.LIB|w32ole
> Error: Unresolved external '_HB_FUN_HSETCASEMATCH' referenced from C:
> \QI\WIN\OBJETOS\GERAL\QILIB.LIB|GERIMP

HBOLE.LIB does not exist in Harbour. I guess it comes from some
old Harbour versions. Inside HBWIN we have new OLE implementation
which should be used instead.

> Error: Unresolved external '_HB_FUN_HASH' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETINIT' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETCONNECT' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETERRORCODE' referenced from C:
> \TMP\HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETERRORDESC' referenced from C:
> \TMP\HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETSETTIMEOUT' referenced from C:
> \TMP\HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETRECVENDBLOCK' referenced from
> C:\TMP\HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETSENDALL' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETCLOSE' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETDESTROY' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETCLEANUP' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_INETRECV' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ

These are xHarbour functions. You should translated them to Harbour ones or
use XHB library or hbcompat.ch where they are wrapped to Harbour functions.

> Error: Unresolved external '_HB_FUN_HB_CRYPT' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ
> Error: Unresolved external '_HB_FUN_HB_DECRYPT' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ

These are also xHarbour functions. They are supported by XHB library
anyhow I strongly suggest to use hb_z*() Harbour core functions which
use newest ZLIB version because above one uses internaly very old copy
of ZLIB code.

> Error: Unresolved external '_HB_FUN_FILESTATS' referenced from C:\TMP
> \HBMK_TBABE2.DIR\QISTART.OBJ

This is xHarbour function supported by XHB library

> Error: Unresolved external '_hb_szAscii' referenced from C:\HRB_BCC\LIB
> \HBPP.LIB|ppcore

HBUSRRDD.LIB is core library and should not be included.

So first eliminate all core libraries from your build scripts.
This is list of core libraries:

hbcommon
hbpp
hbrtl
hbmacro
hblang
hbcpage
hbextern
hbrdd
rddntx
rddnsx
rddcdx
rddfpt
hbsix
hbhsx
hbusrrdd
gtcgi
gtpca
gtstd
gtwvt
gtgui
gtwin
gtos2
gttrm
gtcrs
gtsln
gtxwc
hbvm
hbvmmt
hbmaindllh

Never include them manually. They are managed automatically by HBMK2.
Even if adding them reduces number of unresolved externals then it
does not fix anything because in such case final binaries can be broken
because they will contain two copies of the same code one from
harbour*.dll and second from above libraries. It may cause any
unpredictable results. Adding core libraries to hbmk2 is always
wrong. When you clean your scirpt then you will see what exactly
is missing. Some problems may come from XHB library which uses
some internal core functions to emulate things like HB_ENUMINDEX()
(see Viktor message about it).
Some other from 3-rd party code you are using.
In most of cases it should be possible to use official Harbour
functions what can eliminate problems but as long as you do not
send log from clean configuration which does not include harbour
core functions we do not know what exactly you need.

best regards,
Przemek

Rossine

unread,
Oct 15, 2010, 5:01:30 PM10/15/10
to Harbour Developers
Hi Przemek,
OK. My .hbc no longer has any of the above specified libs

Including xhb.lib in my hbc now I only see these errors:

Error: Unresolved external '_hb_winmainArgInit' referenced from C:
\HRB_BCC\LIB\HBMAINWIN.LIB|mainwin
Error: Unresolved external '_hb_stackBaseOffset' referenced from C:
\HRB_BCC\LIB\XHB.LIB|xhbenum
Error: Unresolved external '_hb_stackItem' referenced from C:\HRB_BCC
\LIB\XHB.LIB|xhbenum
Error: Unable to perform link

I'll look in harbour equivalent functions listed below XHB

Error: Unresolved external '_hb_winmainArgInit' referenced from C:
\HRB_BCC\LIB\HBMAINWIN.LIB|mainwin
Error: Unresolved external '_HB_FUN_HB_DUMPVAR' referenced from C:
\SQLLIB\LIB\SQLLIB.LIB|sl_tostring
Error: Unresolved external '_HB_FUN_HB_ENUMINDEX' referenced from C:
\TMP\HBMK_ABBB0J.DIR\QILIBM.OBJ
Error: Unresolved external '_HB_FUN_HSETCASEMATCH' referenced from C:
\QI\WIN\OBJETOS\GERAL\QILIB.LIB|GERIMP
Error: Unresolved external '_HB_FUN_HASH' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETINIT' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETCONNECT' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETERRORCODE' referenced from C:
\TMP\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETERRORDESC' referenced from C:
\TMP\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETSETTIMEOUT' referenced from C:
\TMP\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETRECVENDBLOCK' referenced from
C:\TMP\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETSENDALL' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETCLOSE' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETDESTROY' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETCLEANUP' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_INETRECV' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_HB_CRYPT' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_HB_DECRYPT' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unresolved external '_HB_FUN_FILESTATS' referenced from C:\TMP
\HBMK_ABBB0J.DIR\QISTART.OBJ
Error: Unable to perform link

Many thank´s for the clarifications.

Best Regards,

Rossine.

Viktor Szakáts

unread,
Oct 15, 2010, 5:07:41 PM10/15/10
to harbou...@googlegroups.com
> Error: Unresolved external '_hb_winmainArgInit' referenced from C:
> \HRB_BCC\LIB\HBMAINWIN.LIB|mainwin

You're still linking this core lib.

> Error: Unresolved external '_hb_stackBaseOffset' referenced from C:
> \HRB_BCC\LIB\XHB.LIB|xhbenum
> Error: Unresolved external '_hb_stackItem' referenced from C:\HRB_BCC
> \LIB\XHB.LIB|xhbenum
> Error: Unable to perform link

See my QUESTION in 2010-10-13 19:33 UTC+0200.
I should have named it TOFIX pbly.

Viktor

Rossine

unread,
Oct 16, 2010, 7:39:05 AM10/16/10
to Harbour Developers
Hello Viktor,

> > Error: Unresolved external '_hb_winmainArgInit' referenced from C:
> > \HRB_BCC\LIB\HBMAINWIN.LIB|mainwin
>
> You're still linking this core lib.

This error is generated when I put it on mine. Hbc

{win}gt=gtgui <--- I took it out this

>
> > Error: Unresolved external '_hb_stackBaseOffset' referenced from C:
> > \HRB_BCC\LIB\XHB.LIB|xhbenum
> > Error: Unresolved external '_hb_stackItem' referenced from C:\HRB_BCC
> > \LIB\XHB.LIB|xhbenum
> > Error: Unable to perform link
>
> See my QUESTION in 2010-10-13 19:33 UTC+0200.
> I should have named it TOFIX pbly.

OK I see. Many thank´s.

Best Regards,

Rossine.

Rossine

unread,
Oct 16, 2010, 9:18:45 AM10/16/10
to Harbour Developers
Hello,

For this error: \HRB_BCC\LIB\XHB.LIB|xhbenum

I changed this:

for each aVarray in aStruct
...
t := hb_enumindex()
...
next

...for this:

for each aVarray in aStruct
...
t := aVarray:__enumIndex()
...
next

...and now my .EXE is generated :)

Many thank´s Mr.Vailton for this tip :)

Best Regards,

Rossine.

Przemysław Czerpak

unread,
Oct 16, 2010, 10:06:19 AM10/16/10
to harbou...@googlegroups.com
On Sat, 16 Oct 2010, Rossine wrote:

Hi,

> For this error: \HRB_BCC\LIB\XHB.LIB|xhbenum

In Harbour you can send to FOR EACH iterator
few __enum*() messages, i.e.:

hValue := { "abc"=>100, "QWE"=>200, "zxc"=>300, "XYZ"=>400 }
FOR EACH v IN hValue
? h:__enumIndex(), h:__enumKey(), h:__enumValue(), h
NEXT

please note that it's possible to use them in nested loops
or iterate more then once variable, i.e.

cValue := "ABCDEF"
aValue := array( len( cValue ) )
FOR EACH c, v IN cValue, aValue
v := c
NEXT

It means that simple function like hb_enumindex() is not enough
for such functionality. We added it only for compatibility with
Harbour.
See doc/xhb-diff.txt for more information about differences between
Harbour and xHarbour.

best regards,
Przemek

Rossine

unread,
Oct 16, 2010, 10:16:50 AM10/16/10
to Harbour Developers
Hello Przemek,

Many thank´s for clarifications. :-)

Best Regards,

Rossine.

Rossine

unread,
Oct 16, 2010, 11:09:46 AM10/16/10
to Harbour Developers
Hi,

Now I can work with my functions in dll :-)

Just that when I call any command from me MiniGUI error occurs as
shown below:

[CODE]

#include "Minigui.ch"

DYNAMIC F1

FUNCTION main()

LOCAL hLib, cVar := "N"

hLib := hb_LibLoad( "test" )

hb_memowrit( "teste.ini", "[CONFIG]" + CRLF + ;
"TEST=S" + CRLF )

msgstop( "Calling F1:" + hb_valtostr( F1( 1, date(), time() ) ) )

begin ini file "TESTE.INI"
get cVar section "CONFIG" entry "TEST"
end ini

msgstop( cVar )

RETURN NIL

[ENDCODE]

When it reaches this line:

begin ini file "TESTE.INI"

occurs this error:

Error BASE/1003 Variable does not exist: _HMG_SYSDATA
Called from _BEGININI(70)
Called from MAIN(16)

That is being defined within minigui.ch:

#ifndef __SYSDATA__
#define __SYSDATA__
MEMVAR _HMG_SYSDATA
#endif

Can anyone help me with this error ?

Thanks in advance,

Rossine.

Rossine

unread,
Oct 16, 2010, 12:43:53 PM10/16/10
to Harbour Developers
Hello All,

Problem Solved :-)

MiniGUI calls the init () function in errorsys and was not calling
her. The following example now works 100%

[CODE]

#include "Minigui.ch"

DYNAMIC F1

FUNCTION main()

LOCAL hLib, cVar := "N"

INIT() && <-- Here New

hLib := hb_LibLoad( "test" )

hb_memowrit( "teste.ini", "[CONFIG]" + CRLF + ;
"TEST=S" + CRLF )

msgstop( "Calling F1:" + hb_valtostr( F1( 1, date(), time() ) ) )

begin ini file "TESTE.INI"
get cVar section "CONFIG" entry "TEST"
end ini

msgstop( cVar )

RETURN NIL

[ENDCODE]

Thank you all for your help,

Best Regards,

Rossine.

Rossine

unread,
Oct 16, 2010, 5:26:29 PM10/16/10
to Harbour Developers
Hello,

Everything was fine now. The only thing now is when I shot mine .hbc:

{win}gt=gtgui

...opens a black window "MS-DOS prompt" window behind my windows. What
do I do this not to appear more black window ?

Best Regards,

Rossine.

Rossine

unread,
Oct 16, 2010, 5:30:42 PM10/16/10
to Harbour Developers
Hello,

With "hbmk2 -gui" does not work also.

Regards,

Rossine.

Przemysław Czerpak

unread,
Oct 20, 2010, 6:28:30 AM10/20/10
to harbou...@googlegroups.com
On Sat, 16 Oct 2010, Rossine wrote:

Hi,

> Everything was fine now. The only thing now is when I shot mine .hbc:


> {win}gt=gtgui
> ...opens a black window "MS-DOS prompt" window behind my windows. What
> do I do this not to appear more black window ?

Probably you have still hard coded hbmainstd in your linked library list.

best regards,
Przemek

Reply all
Reply to author
Forward
0 new messages