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

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

Postby Compuin » Tue Apr 26, 2016 4: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 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

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

Postby Antonio Linares » Tue Apr 26, 2016 5:31 pm

Puedes copiar aqui el PRG que estas intentando compilar ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Compuin » Tue Apr 26, 2016 5:40 pm

Aqui lo tiene

Code: Select all  Expand view  RUN

# 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 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

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

Postby Antonio Linares » Tue Apr 26, 2016 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Compuin » Tue Apr 26, 2016 6:31 pm

Gracias

Yo lo quiero intentar con xHarbour. Estoy usando el 1.2.3
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

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

Postby Antonio Linares » Tue Apr 26, 2016 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Compuin » Tue Apr 26, 2016 6:43 pm

Da el mismo error

No se si tiene que ver con el main que esta llamandolo
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

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

Postby Antonio Linares » Tue Apr 26, 2016 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby cnavarro » Tue Apr 26, 2016 7: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.

Last edited by cnavarro on Tue Apr 26, 2016 7:12 pm, edited 1 time in total.
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
User avatar
cnavarro
 
Posts: 6552
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

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

Postby Compuin » Tue Apr 26, 2016 7:10 pm

Aparentement es el main
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

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

Postby Compuin » Tue Apr 26, 2016 8: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 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

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

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Compuin » Tue Apr 26, 2016 10:45 pm

Como puedo hacer una prueba para validar eso?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

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

Postby Antonio Linares » Wed Apr 27, 2016 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42203
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Compuin » Wed Apr 27, 2016 10:08 am

Ok

Probare y dejare saber
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Compuin
 
Posts: 1214
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 22 guests

cron