Page 1 of 1

harbour v1.x -> v.3x Error

Posted: Thu Oct 17, 2019 10:55 pm
by Jimmy
hi,

i have a old harbour v1.x Source Code and try to run it under v3.x and got these Error
----------------------------------------------------------------------------------------------------
Project [ HbXbase ] Launch [ Yes ] Rebuild [ Yes ] Started [ 08:58:35 ]
----------------------------------------------------------------------------------------------------
Batch File Exists => R:\Temp\s5bwew.bat
Batch File Contents =>
C:\harbour\bin\hbmk2.exe E:\harbour\CAL\HbXbase.hbp -q -trace -info -lang=en -width=512 -rebuild
Command => C:\WINDOWS\system32\cmd.exe
Arguments => /C R:\Temp\s5bwew.bat
----------------------------------------------------------------------------------------------------
CurDir() => Users\a\Desktop Starting in => E:\harbour\CAL\

E:\harbour\CAL>C:\harbour\bin\hbmk2.exe E:\harbour\CAL\HbXbase.hbp -q -trace -info -lang=en -width=512 -rebuild
hbmk2: Autodetected platform: win
hbmk2: Autodetected C compiler: bcc
hbmk2: Using Harbour: C:\harbour\bin C:\harbour\include C:\harbour\lib\win\bcc C:\harbour\bin
hbmk2: Using C compiler: C:\bcc55\bin\bcc32.exe
hbmk2: Processing local make script: hbmk.hbm
hbmk2: Processing: hbxpp.hbc
hbmk2: Processing: gtwvg.hbc
hbmk2: Processing: C:\harbour\contrib\hbwin\hbwin.hbc
hbmk2: Compiling Harbour sources...
hbmk2: Harbour compiler command (embedded):
(C:\harbour\bin\harbour.exe) -n2 E:\harbour\CAL\HBXBASE.PRG -w1 -es2 -q -o.hbmk\win\bcc\ -iC:\bcc55\Include -iC:\harbour\include -ic:\hmg.3.4.4\HARBOUR\contrib\hbxpp -ic:\hmg.3.4.4\HARBOUR\contrib\gtwvg -iC:\harbour\contrib\hbwin -undef:.ARCH. -D__PLATFORM__WINDOWS -D__LITTLE_ENDIAN__ -D__ARCH32BIT__
Harbour 3.0.0 (Rev. 16951)
Copyright (c) 1999-2011, http://harbour-project.org/

hbmk2: Compiling...
hbmk2: C/C++ compiler command:
bcc32.exe -c -q -d -6 -O2 -OS -Ov -Oi -Oc -tW -tWM -w -Q -w-sig- -n.hbmk\win\bcc -IC:\bcc55\Include -IC:\harbour\include -Ic:\hmg.3.4.4\HARBOUR\contrib\hbxpp -Ic:\hmg.3.4.4\HARBOUR\contrib\gtwvg -IC:\harbour\contrib\hbwin .hbmk\win\bcc\HBXBASE.c .hbmk\win\bcc\_hbmkaut_HBXBASE.c

.hbmk\win\bcc\HBXBASE.c:
Warning W8065 E:\\harbour\\CAL\\HBXBASE.PRG 196: Call to function 'hb_itemGetDD' with no prototype in function HB_FUN_DATEASDOUBLE
.hbmk\win\bcc\_hbmkaut_HBXBASE.c:
hbmk2: Linking... HBXBASE.exe
hbmk2: Linker command:
ilink32.exe @R:\Temp\5rn3ik.lnk
hbmk2: Linker script:
-Gn -Tpe -LC:\bcc55\Lib;C:\bcc55\Lib\PSDK;C:\harbour\lib\win\bcc;C:\harbour\bin -aa c0w32.obj .hbmk\win\bcc\HBXBASE.obj .hbmk\win\bcc\_hbmkaut_HBXBASE.obj, HBXBASE.exe, nul, gtwvg.lib hbxpp.lib hbwin.lib png.lib hbextern.lib hbdebug.lib hbvmmt.lib hbrtl.lib hblang.lib hbcpage.lib gtcgi.lib gtpca.lib gtstd.lib gtwin.lib gtwvt.lib gtgui.lib hbrdd.lib hbuddall.lib hbusrrdd.lib rddntx.lib rddcdx.lib rddnsx.lib rddfpt.lib hbrdd.lib hbhsx.lib hbsix.lib hbmacro.lib hbcplr.lib hbpp.lib hbcommon.lib kernel32.lib user32.lib gdi32.lib advapi32.lib ws2_32.lib winspool.lib comctl32.lib comdlg32.lib shell32.lib uuid.lib ole32.lib oleaut32.lib mpr.lib winmm.lib mapi32.lib imm32.lib msimg32.lib wininet.lib hbpcre.lib hbzlib.lib cw32mt.lib import32.lib, ,

Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_hb_itemGetDD' referenced from E:\HARBOUR\CAL\.HBMK\WIN\BCC\HBXBASE.OBJ
Error: Unresolved external '_HB_FUN_HB_TOOUTDEBUG' referenced from E:\HARBOUR\CAL\.HBMK\WIN\BCC\HBXBASE.OBJ
Error: Unresolved external '_HB_FUN_WIN_DESTROYMENU' referenced from E:\HARBOUR\CAL\.HBMK\WIN\BCC\HBXBASE.OBJ
Error: Unresolved external '_HB_FUN_OLERELEASEOBJECT' referenced from E:\HARBOUR\CAL\.HBMK\WIN\BCC\HBXBASE.OBJ
Error: Unresolved external '_HB_FUN_WIN_GETDESKTOPWINDOW' referenced from E:\HARBOUR\CAL\.HBMK\WIN\BCC\HBXBASE.OBJ
Error: Unresolved external '_HB_FUN_SECTOTIME' referenced from E:\HARBOUR\CAL\.HBMK\WIN\BCC\HBXBASE.OBJ
Error: Unresolved external '_HB_FUN_TIMETOSEC' referenced from E:\HARBOUR\CAL\.HBMK\WIN\BCC\HBXBASE.OBJ
Error: Unresolved external '_HB_FUN_WIN_MESSAGEBOX' referenced from E:\HARBOUR\CAL\.HBMK\WIN\BCC\HBXBASE.OBJ
Error: Unresolved external '_HB_FUN_XHB_LIB' referenced from E:\HARBOUR\CAL\.HBMK\WIN\BCC\HBXBASE.OBJ

hbmk2: Error: Running linker. 2
ilink32.exe @R:\Temp\5rn3ik.lnk

----------------------------------------------------------------------------------------------------
Exit Code [ 7 ] Exit Status [ 0 ] Finished at [ 08:58:36 ] Done in [ 1.30 Secs ]
----------------------------------------------------------------------------------------------------

Detected executable => E:\harbour\CAL\HBXBASE.exe

Sorry, cannot launch project because of errors...
these Error are from "internal" harbour function which Pritpal Bedi use

Code: Select all

#IFDEF __XPP__
#ELSE
   #pragma BEGINDUMP

   #include "item.api"
   #include "hbdefs.h"
   #include "hbvmpub.h"
   #include "hbinit.h"
   #include "hbapi.h"
   #include "hbapiitm.h"
   #include "hbvm.h"
   #include "hbapierr.h"

   #include <windows.h>
   #include <commdlg.h>
   #include <commctrl.h>
   #include <shlobj.h>
   #include <tchar.h>
   #include <comcat.h>
   #include <wingdi.h>

   HB_FUNC( DATEASLONG )            
   {
      PHB_ITEM pDate = hb_param( 1, HB_IT_DATE );

      if( pDate )
         hb_retnl( hb_itemGetDL( pDate ) );     // ERROR
      else
         hb_retnl( 0 );
   }

   // more HB_FUNC()

   #pragma ENDDUMP

   #include 'hbclass.ch'
   #include 'common.ch'
   #include 'inkey.ch'
   #include 'wvtwin.ch'
   #include 'xhb.ch'
   #include 'hbgtinfo.ch'
   #include 'wvgparts.ch'
   #include 'hbgtwvg.ch'

   REQUEST DBFNTX
   REQUEST DBFDBT

   #xcommand METHOD <!ClassName!>:<MethodName> => METHOD <MethodName> CLASS <ClassName>

#ENDIF

Code: Select all

    STATIC FUNCTION uiDebug( p1 )
#IFDEF __XPP__
#ELSE
       hb_ToOutDebug( p1 )              // ERROR
#ENDIF
       RETURN NIL

    //----------------------------------------------------------------------//
    #IFDEF __XPP__
    #ELSE
    FUNCTION HB_GTSYS()
       REQUEST HB_GT_GUI_DEFAULT
       REQUEST HB_GT_WVG
       REQUEST HB_GT_WVT
       REQUEST HB_GT_WGU
       RETURN NIL

    STATIC FUNCTION AppDeskTop()
       LOCAL oDeskTop := WvgWindow():New()

       oDeskTop:hWnd := Win_GetDesktopWindow()      // ERROR
       #if 0
       oDeskTop:hWnd := HB_INLINE(){
          hb_retnint( ( LONG ) GetDesktopWindow() );
       }
       #endif
       RETURN oDeskTop

    STATIC FUNCTION VOU_DateTime2DateTime( dDateTime )
       LOCAL nDtTm := DateAsDouble( dDateTime )
       LOCAL dDate := dDateTime
       LOCAL nSecs := ( nDtTm - Int( nDtTm ) ) * ( 24*60*60 )
    //uiDebug( dDateTime, nDtTm, nSecs )
       RETURN { dDate, SecToTime( nSecs ) }     // ERROR

    STATIC FUNCTION VOU_DateTime( dDate, cTime )
       RETURN DateAsLong( dDate-2415019 ) + ( TimeToSec( cTime ) / ( 24*60*60 ) )

    STATIC FUNCTION TimeValue( cTime )
       RETURN ( TimeToSec( cTime ) / ( 24*60*60 ) ) // ERROR

    STATIC FUNCTION MsgBox( cMessage, cTitle )
       RETURN Win_MessageBox( , cMessage, cTitle )  // ERROR

    STATIC FUNCTION AltD()
       RETURN nil

    STATIC FUNCTION AppName( lWithPath )
       LOCAL n
       LOCAL cName := hb_argV( 0 )          // ERROR
       //
       DEFAULT lWithPath TO .f.
       //
       IF !( lWithPath )
          IF ( n := rat( "\", cName ) ) > 0
             cName := substr( cName, n+1 )
          ENDIF
       ENDIF
       //
       RETURN  cName

    #ENDIF
i have no Idea how to get it work under harbour v3.x :(
can someone help me please to get that Sample working.

Re: harbour v1.x -> v.3x Error

Posted: Fri Oct 18, 2019 6:24 am
by Antonio Linares
Jimmy,

Please provide complete HBXBASE.prg source code so we can help you to fix it, thanks

Re: harbour v1.x -> v.3x Error

Posted: Fri Oct 18, 2019 7:10 am
by Jimmy
Antonio Linares wrote:Please provide complete HBXBASE.prg source code so we can help you to fix it, thanks
Ok, i will prepare a hole Demo.