FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Error E0019 #error: 'Class not declared for method:
Posts: 1276
Joined: Tue Dec 28, 2010 01:29 PM
Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 04:20 PM

A que se debe este error

Error E0019 #error: 'Class not declared for method:

MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
\xharbour\bin\harbour .\prg\TPUBLIC.PRG /a /m /n /v /d__HARBOUR__;__FLAT
__ /W0 /Oobj\ /I\fwh\include\;\xharbour\include\ >log-prg.txt
.\prg\TPUBLIC.PRG(156) Error E0019 #error: 'Class "TPublic" not declared for me
thod: New( automata )'
.\prg\TPUBLIC.PRG(167) Error E0019 #error: 'Class "TPublic" not declared for me
thod: Add( cName, xValue )'
.\prg\TPUBLIC.PRG(197) Error E0019 #error: 'Class "TPublic" not declared for me
thod: Del( cName )'
.\prg\TPUBLIC.PRG(215) Error E0019 #error: 'Class "TPublic" not declared for me
thod: Get( cName )'
.\prg\TPUBLIC.PRG(227) Error E0019 #error: 'Class "TPublic" not declared for me
thod: Set( cName, xValue )'
.\prg\TPUBLIC.PRG(241) Error E0019 #error: 'Class "TPublic" not declared for me
thod: GetPos( cName )'
.\prg\TPUBLIC.PRG(251) Error E0019 #error: 'Class "TPublic" not declared for me
thod: Release()'
.\prg\TPUBLIC.PRG(262) Error E0019 #error: 'Class "TPublic" not declared for me
thod: IsDef( cName )'
.\prg\TPUBLIC.PRG(279) Error E0019 #error: 'Class "TPublic" not declared for me
thod: OnError( uParam1 )'

** error 1 ** deleting .\obj\TPUBLIC.OBJ

FWH 25.12

Harbour/Hbmk2

Microsoft Visual C++

MySql 8.0

Antigravity

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 05:31 PM

Puedes copiar aqui el PRG que estas intentando compilar ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1276
Joined: Tue Dec 28, 2010 01:29 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 05:40 PM
Aqui lo tiene

Code (fw): Select all Collapse
# include "FiveWin.ch"

#ifdef __xHARBOUR__
  # xtranslate BYNAME <V> [, <VN> ]     => ::<V> := <V> [; ::<VN> := <VN> ]
  # xtranslate BYNAME <V> DEFAULT <Val> => ::<V> := BYDEFAULT <V>, <Val>
  # xtranslate BYNAME <V> IFNONIL       => if <V> != NIL ; ::<V> := <V> ; endif
  # xtranslate BYDEFAULT <V>, <Val>     => if( <V> == NIL, <Val>, <V> )
#endif

CLASS TPublic

   DATA  automata  AS LOGICAL     INIT .T.    

   DATA  aVars       AS ARRAY       INIT NIL
   DATA  nPos        AS NUMERIC     INIT 0   READONLY 
   DATA  cName       AS CHARACTER   INIT ""  READONLY 

   METHOD New( automata )
   METHOD End()      INLINE ::Release()

   METHOD Add( cName, xValue )
   METHOD Del( cName )
   METHOD Get( cName )
   METHOD Set( cName, xValue )

   METHOD GetPos( cName )

   METHOD Release()
   METHOD IsDef( cName )

   METHOD Clone()    INLINE aClone( ::aClone )
   METHOD nCount()      INLINE Len( ::aVars )

   METHOD Save()     INLINE aClone( ::aVars )
   METHOD Restore( aVars ) INLINE ::aVars := aClone( aVars )

#ifdef __HARBOUR__
   ERROR HANDLER OnError( uParam1 )
#else
   ERROR HANDLER OnError( cMsg, nError )
#endif

ENDCLASS


METHOD New( automata ) CLASS TPublic 

   ::aVars := {}

RETURN Self


METHOD Add( cName, xValue ) CLASS TPublic

  if cName != NIL
    if (::nPos := aScan( ::aVars, { |e,n| e[1] == AllTrim(Upper(cName)) } )) != 0
      ::aVars[::nPos,2] := xValue

#ifndef __HARBOUR__                 
    elseif Len(::aVars) < 4000     
      aAdd( ::aVars, { AllTrim(Upper(cName)), xValue } )
      ::nPos := Len(::aVars)

    else
      MsgAlert("Demasiadas variables definidas para la Clase TPublic()")

#else
    else
      aAdd( ::aVars, { AllTrim(Upper(cName)), xValue } )
      ::nPos := Len(::aVars)
#endif                              

    endif

    ::cName  := cName
  endif

RETURN Self


METHOD Del( cName ) CLASS TPublic
   local nPos

   if cName != NIL
      if (nPos := aScan( ::aVars, { |e,n| e[1] == AllTrim(Upper(cName)) } )) != 0
         aDel( ::aVars, nPos )
         ::aVars := aSize( ::aVars, Len(::aVars) - 1 )

         ::nPos   := 0
         ::cName  := ""
      endif
   endif

RETURN Self


METHOD Get( cName ) CLASS TPublic                  

   if cName != ::cName
      ::nPos   := aScan( ::aVars, { |e,n| e[1] == AllTrim(Upper(cName)) } )
      ::cName  := cName
   endif

RETURN ::aVars[::nPos,2]


METHOD Set( cName, xValue ) CLASS TPublic            

   if cName != ::cName
      ::nPos   := aScan( ::aVars, { |e,n| e[1] == AllTrim(Upper(cName)) } )
      ::cName  := cName
   endif

   ::aVars[::nPos,2] := xValue

RETURN Self


METHOD GetPos( cName ) CLASS TPublic

   ::cName  := cName

RETURN ::nPos := aScan( ::aVars, { |e,n| e[1] == AllTrim(Upper(cName)) } )


METHOD Release() CLASS TPublic

   ASIZE(::aVars,0)
   ::cName  := ""
   ::nPos   := 0

RETURN Self


METHOD IsDef( cName ) CLASS TPublic              

   local lOk := .F.

   if cName != NIL
      if (::nPos := aScan( ::aVars, { |e,n| e[1] == AllTrim(Upper(cName)) } )) != 0
         ::cName := cName
         lOk := .T.
      endif
   endif

RETURN lOk


#ifdef __HARBOUR__
   METHOD OnError( uParam1 ) CLASS TPublic
      local cMsg   := __GetMessage()
      local nError := If( SubStr( cMsg, 1, 1 ) == "_", 1005, 1004 )
#else
   METHOD OnError( cMsg, nError ) CLASS TPublic
      local uParam1 := GetParam( 1, 1 )
#endif

   cMsg := Upper( AllTrim( cMsg ))

   if SubStr( cMsg, 1, 1 ) == "_"
      cMsg := SubStr( cMsg, 2 )

      if cMsg == Upper(::cName)
         ::aVars[::nPos,2] := uParam1

      elseif ( ::nPos := aScan( ::aVars, { |e,n| e[1] == cMsg } ) ) != 0
         ::cName  := cMsg
         ::aVars[::nPos,2] := uParam1

      else

         if !::automata  
            _ClsSetError( _GenError( nError, ::ClassName(), cMsg ) )
            ::cName  := ""
            ::nPos   := 0
         else
            ::add(cmsg)
            ::aVars[::nPos,2] := uParam1
         endif
      endif
   else
      if cMsg == Upper(::cName)          
         RETURN ::aVars[::nPos,2]

      elseif ( ::nPos := aScan( ::aVars, { |e,n| e[1] == cMsg } ) ) != 0
         ::cName  := cMsg
         RETURN ::aVars[::nPos,2]
      else
         _ClsSetError( _GenError( nError, ::ClassName(), cMsg ) )
         ::cName  := ""
         ::nPos   := 0
      endif
   endif

RETURN NIL

FWH 25.12

Harbour/Hbmk2

Microsoft Visual C++

MySql 8.0

Antigravity

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 06:28 PM
Con la versi贸n actual de Harbour y FWH 16.03 compila bien, sin errores:

c:\temp>c:\harbour\bin\harbour /n /ic:\fwh\include /ic:\harbour\include tpublic.prg
Harbour 3.2.0dev (r1603082110)
Copyright (c) 1999-2016, http://harbour-project.org/
Compiling 'tpublic.prg'...
Lines 4748, Functions/Procedures 10
Generating C source output to 'tpublic.c'... Done.


Puedes descargar el Harbour que he usado desde aqui:
https://bitbucket.org/fivetech/harbour-xharbour-builds/downloads/harbour_3.2_32bits_Borland7_20160309.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1276
Joined: Tue Dec 28, 2010 01:29 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 06:31 PM

Gracias

Yo lo quiero intentar con xHarbour. Estoy usando el 1.2.3

FWH 25.12

Harbour/Hbmk2

Microsoft Visual C++

MySql 8.0

Antigravity

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 06:37 PM
Con xHarbour tambien compila bien:

c:\temp>c:\xharbour\bin\harbour /n /ic:\fwh\include /ic:\xharbour\include tpublic.prg
xHarbour 1.2.3 Intl. (SimpLex) (Build 20151110)
Copyright 1999-2015, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'tpublic.prg'...
Generating C source output to 'tpublic.c'...
Done.
Lines 198, Functions/Procedures 10, pCodes 798


Lo puedes descargar desde aqui:
https://bitbucket.org/fivetech/harbour-xharbour-builds/downloads/xharbour_32bits_bcc7_2015Nov.zip
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1276
Joined: Tue Dec 28, 2010 01:29 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 06:43 PM

Da el mismo error

No se si tiene que ver con el main que esta llamandolo

FWH 25.12

Harbour/Hbmk2

Microsoft Visual C++

MySql 8.0

Antigravity

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 07:01 PM

Posiblemente estes usando un xHarbour incorrecto 贸 sus ficheros de cabecera no sean los correctos

Que versi贸n de FWH est谩s usando ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 07:02 PM
Debe ser tu Main o llamada porque a mi tambien me compila bien



Harbour 3.2.0dev (r1601050904)
Copyright (c) 1999-2015, http://harbour-project.org/
Compiling 'Noname.prg'...
Lines 4788, Functions/Procedures 10
Generating C source output to 'Noname.c'... Done.
Turbo Incremental Link 6.70 Copyright (c) 1997-2014 Embarcadero Technologies, Inc.

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 1276
Joined: Tue Dec 28, 2010 01:29 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 07:10 PM

Aparentement es el main

FWH 25.12

Harbour/Hbmk2

Microsoft Visual C++

MySql 8.0

Antigravity

Posts: 1276
Joined: Tue Dec 28, 2010 01:29 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 08:13 PM

Este es el archivo MAIN.PRG que llama a la clase tpublic

INCLUDE "fivewin.CH"

STATIC oBmp

FUNCTION main()
LOCAL oIco, oBar

SET DELETE OFF

PUBLIC oApp

oApp :=TPublic():New( .t. )

RETURN NIL

Contiua el error

FWH 25.12

Harbour/Hbmk2

Microsoft Visual C++

MySql 8.0

Antigravity

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 10:17 PM

Pienso que no est谩s usando los ficheros de cabecera correctos

Rev铆salo

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1276
Joined: Tue Dec 28, 2010 01:29 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Tue Apr 26, 2016 10:45 PM

Como puedo hacer una prueba para validar eso?

FWH 25.12

Harbour/Hbmk2

Microsoft Visual C++

MySql 8.0

Antigravity

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Wed Apr 27, 2016 06:57 AM

Reinstala xharbour desde el enlace que te he proporcionado y antes borra todos los ficheros de cabecera de tu ordenador

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1276
Joined: Tue Dec 28, 2010 01:29 PM
Re: Error E0019 #error: 'Class not declared for method:
Posted: Wed Apr 27, 2016 10:08 AM

Ok

Probare y dejare saber

FWH 25.12

Harbour/Hbmk2

Microsoft Visual C++

MySql 8.0

Antigravity