FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour errores al compilar Leto - solucionado
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
errores al compilar Leto - solucionado
Posted: Sat Mar 03, 2012 05:16 PM
Hola,

En Borland C++, 驴cu谩l es la funci贸n para GetComputerName( szValue, &ulLen ) ?. Igual debo de a帽adir alguna lib de Borland, pero no se cu谩l es.

Adem谩s, tengo los siguientes errores al compilar leto, y no tengo ni idea c贸mo solucionarlos:

Code (fw): Select all Collapse
/*
聽* $Id: errint.c,v 1.6 2010/06/02 07:08:44 aokhotnikov Exp $
聽*/

/*
聽* Harbour Project source code:
聽* The Error API (internal error)
聽*
聽* Copyright 1999-2004 Viktor Szakats <viktor.szakats@syenar.hu>
聽* www - <!-- m --><a class="postlink" href="http://www.harbour-project.org">http://www.harbour-project.org</a><!-- m -->
聽*
聽* Copyright 2009 Alexander S. Kresin <alex / at / belacy.belgorod.su>
聽* updated for Leto db server
聽*
聽* This program is free software; you can redistribute it and/or modify
聽* it under the terms of the GNU General Public License as published by
聽* the Free Software Foundation; either version 2, or (at your option)
聽* any later version.
聽*
聽* This program is distributed in the hope that it will be useful,
聽* but WITHOUT ANY WARRANTY; without even the implied warranty of
聽* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 聽See the
聽* GNU General Public License for more details.
聽*
聽* You should have received a copy of the GNU General Public License
聽* along with this software; see the file COPYING. 聽If not, write to
聽* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
聽* Boston, MA 02111-1307 USA (or visit the web site <!-- m --><a class="postlink" href="http://www.gnu.org/">http://www.gnu.org/</a><!-- m -->).
聽*
聽* As a special exception, the Harbour Project gives permission for
聽* additional uses of the text contained in its release of Harbour.
聽*
聽* The exception is that, if you link the Harbour libraries with other
聽* files to produce an executable, this does not by itself cause the
聽* resulting executable to be covered by the GNU General Public License.
聽* Your use of that executable is in no way restricted on account of
聽* linking the Harbour library code into it.
聽*
聽* This exception does not however invalidate any other reasons why
聽* the executable file might be covered by the GNU General Public License.
聽*
聽* This exception applies only to the code released by the Harbour
聽* Project under the name Harbour. 聽If you copy code from other
聽* Harbour Project or Free Software Foundation releases into a copy of
聽* Harbour, as the General Public License permits, the exception does
聽* not apply to the code that you add in this way. 聽To avoid misleading
聽* anyone as to the status of such modified files, you must delete
聽* this exception notice from them.
聽*
聽* If you write modifications of your own for Harbour, it is your choice
聽* whether to permit this exception to apply to your modifications.
聽* If you do not wish that, delete this exception notice.
聽*
聽*/

#include "hbapi.h"
#include "hbapierr.h"
#include "hbapilng.h"
#include "hbdate.h"
#include "hbset.h"
#if defined (__XHARBOUR__) || !defined(__HARBOUR__) || ( (__HARBOUR__ - 0) < 0x020000 )
#define LETO_ERRCODE ULONG
#else
#define LETO_ERRCODE HB_ERRCODE
#endif

static BOOL 聽 bErrHandlerRun = 0;
extern void leto_errInternal( ULONG ulIntCode, const char * szText, const char * szPar1, const char * szPar2 );

void hb_errInternalRaw( LETO_ERRCODE ulIntCode, const char * szText, const char * szPar1, const char * szPar2 )
{

聽 聽if( szPar1 == NULL )
聽 聽 聽 szPar1 = "";

聽 聽if( szPar2 == NULL )
聽 聽 聽 szPar2 = "";

聽 聽if( !bErrHandlerRun )
聽 聽{
聽 聽 聽 bErrHandlerRun = 1;
聽 聽 聽 leto_errInternal( (ULONG) ulIntCode, szText, szPar1, szPar2 );
聽 聽}
聽 聽else
聽 聽{
聽 聽 聽 FILE * hLog;
聽 聽 聽 hLog = hb_fopen( "letodb_crash.log", "a+" );

聽 聽 聽 if( hLog )
聽 聽 聽 {
聽 聽 聽 聽 聽fprintf( hLog, "Unrecoverable error %lu: ", (ULONG) ulIntCode );
聽 聽 聽 聽 聽if( szText )
聽 聽 聽 聽 聽 聽 fprintf( hLog, "%s %s %s\n", szText, szPar1, szPar2 );
聽 聽 聽 聽 聽fclose( hLog );
聽 聽 聽 }
聽 聽}

}

void hb_errInternal( LETO_ERRCODE ulIntCode, const char * szText, const char * szPar1, const char * szPar2 )
{
聽 聽hb_errInternalRaw( ulIntCode, szText, szPar1, szPar2 );

聽 聽/* release console settings */
聽 聽hb_conRelease();

聽 聽if( hb_cmdargCheck( "ERRGPF" ) )
聽 聽{
聽 聽 聽 聽int *pGPF = NULL;
聽 聽 聽 聽*pGPF = 0;
聽 聽 聽 聽*(--pGPF) = 0;
聽 聽}

聽 聽exit( EXIT_FAILURE );
}



Los errores son:
Code (fw): Select all Collapse
Error E2141 source\server\errint.c 67: Declaration syntax error
Error E2147 source\server\errint.c 68: 'ULONG' cannot start a
parameter declaration
Error E2451 source\server\errint.c 79: Undefined symbol
'bErrHandlerRun' in function hb_errInternalRaw
Error E2451 source\server\errint.c 82: Undefined symbol 'ULONG' in
function hb_errInternalRaw
Error E2121 source\server\errint.c 82: Function call missing ) in
function hb_errInternalRaw
Error E2451 source\server\errint.c 91: Undefined symbol 'ULONG' in
function hb_errInternalRaw
Error E2121 source\server\errint.c 91: Function call missing ) in
function hb_errInternalRaw
Warning W8057 source\server\errint.c 98: Parameter 'ulIntCode' is
never used in function hb_errInternalRaw



Agradecer铆a much铆simo una ayuda. Adem谩s, esto servir谩 para otros usuarios pues Leto tiene muy buena pinta.

Muchas gracias.
Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: errores al compilar Leto
Posted: Sat Mar 03, 2012 05:36 PM
Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: errores al compilar Leto
Posted: Sat Mar 03, 2012 09:00 PM

Lucas,

Cambia BOOL por HB_BOOL y ULONG por HB_ULONG

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: errores al compilar Leto
Posted: Sat Mar 03, 2012 09:32 PM

Antonio,

Mil gracias, funciona pefecto.

Me falta por favor el tema de en Borland C++, 驴cu谩l es la funci贸n para GetComputerName( szValue, &ulLen ) ?. Igual debo de a帽adir alguna lib de Borland, pero no se cu谩l es.

Eres el Maestro!!.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: errores al compilar Leto
Posted: Sat Mar 03, 2012 10:12 PM
Lucas,

No tienes que a帽adir nada. La funci贸n GetComputerName() es propia del API de Windows:

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724295(v=vs.85).aspx

Solo tienes que crear la funci贸n en C para acceder a ella:

Code (fw): Select all Collapse
#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( GETCOMPUTERNAME )
{
   char buffer[ MAX_COMPUTERNAME_LENGTH + 1 ];
   DWORD dwLen = MAX_COMPUTERNAME_LENGTH; 

   GetComputerName( buffer, &dwLen );
   hb_retc( buffer );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: errores al compilar Leto
Posted: Sat Mar 03, 2012 10:24 PM
Antonio,

Muchas gracias de nuevo.

El problema es que en el .c no encuentra al compilar la funci贸n de c GetComputerName

El c贸digo en c es:

Code (fw): Select all Collapse
#elif defined(HB_OS_WIN_32) || defined( HB_OS_WIN )

   DWORD ulLen = MAX_COMPUTERNAME_LENGTH+1;
   char szValue[MAX_COMPUTERNAME_LENGTH+1], *szRet;

   szValue[ 0 ] = '\0';
   GetComputerName( szValue, &ulLen );

   ulLen = strlen( szValue );
   szRet = (char*) hb_xgrab( ulLen+1 );
   memcpy( szRet, szValue, ulLen );
   szRet[ulLen] = '\0';
   return szRet;

#else

   return NULL;

#endif
}
Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: errores al compilar Leto
Posted: Sun Mar 04, 2012 08:47 AM

Que error te aparece ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: errores al compilar Leto
Posted: Sun Mar 04, 2012 11:22 AM

Hola,

Estaba usando una versi贸n vieja.

Para descargar hay que hacer
cvs -d:pserver:anonymous@letodb.cvs.sourceforge.net:/cvsroot/letodb co -P -r rel-1-mt letodb

De momento, funciona muy bien.

Muchas gracias por la ayuda.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producci贸n]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.

Continue the discussion