Page 1 of 1

Urgent : linking problem after bugfix FWH 8.04 of April 18th

Posted: Tue Apr 22, 2008 1:23 pm
by driessen
Antonio,

As you mentioned in another topic, I downloaded and installed the bugfix of FWH 8.04 last friday.

Since the bugfix I got an error while linking : "Unresolved external symbol '_HB_FUN___CLSACTIVE".

Can this be solved ASAP ? I'm stuck right now and I am waiting for your answer quite urgently.

Thanks a lot in advance.

Posted: Tue Apr 22, 2008 1:30 pm
by Antonio Linares
Michel,

Are you using xHB commercial ?

If yes, you do need a new beta from Patrick Mast

Posted: Tue Apr 22, 2008 1:33 pm
by Antonio Linares
Michel,

Temporarly please try to add this code to your main PRG:

Code: Select all

#pragma BEGINDUMP

#include <hbapi.h>
#include <hbapiitm.h>

HB_FUNC( __CLSACTIVE )
{
   // HB_THREAD_STUB_ANY

   USHORT uiClass = ( USHORT ) hb_parni( 1 );
   PHB_ITEM *pBase = hb_stackGetBase( 1 );

   if( pBase && uiClass && uiClass <= s_uiClasses )
   {
      PCLASS pClass = s_pClasses + ( uiClass - 1 );

      if( pClass->pClsSymbol == (*pBase)->item.asSymbol.value )
      {
         pClass->bActive = TRUE;
         hb_retl( TRUE );
         return;
      }
   }
   hb_retl( FALSE );
}

#pragma ENDDUMP

Posted: Tue Apr 22, 2008 1:41 pm
by Antonio Linares
This is a better version, but still has a missing symbol:

Code: Select all

#pragma BEGINDUMP 

#include <hbapi.h> 
#include <hbapiitm.h>
#include <hbstack.h> 
#include <classes.h>

USHORT hb_clsMaxClasses( void );

HB_FUNC( __CLSACTIVE ) 
{ 
   // HB_THREAD_STUB_ANY 

   USHORT uiClass = ( USHORT ) hb_parni( 1 ); 
   PHB_ITEM *pBase = hb_stackGetBase( 1 ); 

   if( pBase && uiClass && uiClass <= hb_clsMaxClasses() ) 
   { 
      PCLASS pClass = s_pClasses + ( uiClass - 1 ); 

      if( pClass->pClsSymbol == (*pBase)->item.asSymbol.value ) 
      { 
         pClass->bActive = TRUE; 
         hb_retl( TRUE ); 
         return; 
      } 
   } 
   hb_retl( FALSE ); 
} 

#pragma ENDDUMP 

Posted: Tue Apr 22, 2008 1:42 pm
by Antonio Linares
Ok, this seems to be a good one:

Code: Select all

#pragma BEGINDUMP 

#include <hbapi.h> 
#include <hbapiitm.h>
#include <hbstack.h> 
#include <classes.h>

USHORT hb_clsMaxClasses( void );
PCLASS hb_clsClassesArray( void );

HB_FUNC( __CLSACTIVE ) 
{ 
   // HB_THREAD_STUB_ANY 

   USHORT uiClass = ( USHORT ) hb_parni( 1 ); 
   PHB_ITEM *pBase = hb_stackGetBase( 1 ); 

   if( pBase && uiClass && uiClass <= hb_clsMaxClasses() ) 
   { 
      PCLASS pClass = hb_clsClassesArray() + ( uiClass - 1 ); 

      if( pClass->pClsSymbol == (*pBase)->item.asSymbol.value ) 
      { 
         pClass->bActive = TRUE; 
         hb_retl( TRUE ); 
         return; 
      } 
   } 
   hb_retl( FALSE ); 
} 

#pragma ENDDUMP 

Posted: Tue Apr 22, 2008 1:49 pm
by driessen
Antonio,

Thanks a lot for such a quick respons.

Indeed I'm using XHB commercial.

Unfortunately I still got an error : "Unknown fiels 'bActive' of 'Class' ".

What now ?

Regards,

Posted: Tue Apr 22, 2008 1:52 pm
by Antonio Linares
Michel,

I can not ensure the results but try this change in xharbour\include\classes.h:

Code: Select all

typedef struct
{
...
   BOOL     bActive;

} CLASS, * PCLASS;
add that bActive struct member in CLASS struct definition. As it is the latest member of the struct then we should not break anything...

Posted: Tue Apr 22, 2008 2:03 pm
by Antonio Linares
I am afraid it will not work as sizeof( CLASS ) is used in several places in vm\classes.c. It may generate GPFs :-(

Another possible solution is to try these two possible functions:
function __CLSACTIVE() ; return .F.
or
function __CLSACTIVE() ; return .T.

I don't like to provide these "kind" of solutions. The right way is a new beta from xHB commercial :-(

Posted: Tue Apr 22, 2008 2:18 pm
by driessen
Antonio,

Thanks a lot for trying to help me.

I'll contact Patrick Mast.

Regards,

Posted: Tue Apr 22, 2008 2:21 pm
by Antonio Linares
Michel,

The problem is that __ClsActive() is called from hbclass.ch so ALL classes are requesting that function now.

Maybe you could try to recompile all classes with older hbclass.ch and this may fix it. But we have not tested it here.

Posted: Sat Apr 26, 2008 6:19 am
by patrickmast
driessen wrote:Antonio,
Thanks a lot for trying to help me.
I'll contact Patrick Mast.
Regards,
Hello Frank,

I'm waiting for some last minute fixes before releasing a new xHarbour Builder Beta.

Patrick