HB_FUNC( SCAVENGEAL )
This sample works fine with Harbour but not with xHarbour. Ron, can you
try to fix it, please?
FUNCTION MAIN()
RETURN NIL
#pragma BEGINDUMP
#ifdef __MYTEST__
HB_FUNC( SCAVENGEAL )
{
}
#endif
#pragma ENDDUMP
With xHarbour:
error LNK2001: unresolved external symbol _HB_FUN_SCAVENGEAL
--
Enrico Maria Giordano
http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg
The issue is because the function is not included due to the #ifdef. Technically the dump scanner can attempt to parse #ifdef to avoid generation of the entry into the symbol table but I am not sure this is desired. Can you please provide a realworld sample where such case can exist intentionally? I mean if the function is in the BEGINDUMP than it will likely also have a prg code calling it so I don't understand what can be a real world case of such issue. Even if there was such case, I suppose
Il 20/09/2023 01:02, Ron Pinkas ha scritto:world sample where such case can exist intentionally? I mean if the function is in the BEGINDUMP than it will likely also have a prg code calling it so I don't understand what can be a real world case of such issue. Even if there was such case, I suppose
The issue is because the function is not included due to the #ifdef. Technically the dump scanner can attempt to parse #ifdef to avoid generation of the entry into the symbol table but I am not sure this is desired. Can you please provide a real
Imagine you want to define a function only for 64-bit mode compilation. Well, you can't:
FUNCTION MAIN()
RETURN NIL
#pragma BEGINDUMP
#ifdef _WIN64
HB_FUNC( MYFUNC64 )
{
}
#endif
#pragma ENDDUMP
In 32-bit mode:
error LNK2001: unresolved external symbol _HB_FUN_MYFUNC64
--
Enrico Maria Giordano
http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg
Il 20/09/2023 16:13, Ron Pinkas ha scritto:
Imagine you want to define a function only for 64-bit mode compilation. >> Well, you can't:
FUNCTION MAIN()
RETURN NIL
#pragma BEGINDUMP
#ifdef _WIN64
HB_FUNC( MYFUNC64 )
{
}
#endif
#pragma ENDDUMP
In 32-bit mode:
error LNK2001: unresolved external symbol _HB_FUN_MYFUNC64
Of course you can:
#ifdef WIN64
#pragma BEGINDUMP
HB_FUNC( SCAVENGEAL )
{
}
#endif
#pragma ENDDUMP
#endifYes, I know, but with Harbour it works in this form too:
FUNCTION MAIN()
RETURN NIL
#pragma BEGINDUMP
#ifdef _WIN64
HB_FUNC( MYFUNC64 )
{
}
#endif
#pragma ENDDUMP
Can we fix it?
--
Enrico Maria Giordano
http://www.emagsoftware.it
http://www.emagsoftware.it/emgmusic
http://www.emagsoftware.it/spectrum
http://www.emagsoftware.it/tbosg
Imagine you want to define a function only for 64-bit mode compilation.
Well, you can't:
FUNCTION MAIN()
RETURN NIL
#pragma BEGINDUMP
#ifdef _WIN64
HB_FUNC( MYFUNC64 )
{
}
#endif
#pragma ENDDUMP
In 32-bit mode:
error LNK2001: unresolved external symbol _HB_FUN_MYFUNC64
Of course you can:
#ifdef WIN64
#pragma BEGINDUMP
HB_FUNC( SCAVENGEAL )
{
}
#endif
#pragma ENDDUMP
#endif
Enrico, I believe the "fix" is wrong
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 251 |
Nodes: | 16 (0 / 16) |
Uptime: | 02:50:50 |
Calls: | 5,571 |
Files: | 11,686 |
Messages: | 5,131,487 |