Página 1 de 1
Erro _stddef.h / assert.h
Enviado: 22 Mar 2010 18:16
por carlosdgs
Boa noite a TODOS!
Estou tentando compilar um programinha que usa :
Código: Selecionar todos
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapifs.h"
#include <stdio.h>
Mas me dá os seguintes erros:
- xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6633)
Copyright 1999-2010, http://www.xharbour.org http://www.harbour-project.org/
Compiling '\SACHB\PRG\FUNCOES\WINDOWS.C'...
_stddef.h(54) Error E0030 Syntax error: "syntax error at 'UNSIGNED'"
_stddef.h(73) Error E0030 Syntax error: "syntax error at 'INT'"
_stddef.h(83) Error E0030 Syntax error: "syntax error at 'UNSIGNED'"
_stddef.h(93) Error E0030 Syntax error: "syntax error at 'WCHAR_T'"
_stddef.h(102) Error E0030 Syntax error: "syntax error at 'WCHAR_T'"
_stddef.h(109) Error E0030 Syntax error: "syntax error at 'LONG'"
assert.h(38) Error E0030 Syntax error: "syntax error at '__CDECL'"
assert.h(41) Error E0030 Syntax error: "syntax error at '__CDECL'"
assert.h(43) Error E0030 Syntax error: "syntax error at '*'"
9 errors
No code generated
Estou usando o bcc55
Desde ja, agradeço a atenção!!
Re: Erro _stddef.h / assert.h
Enviado: 22 Mar 2010 21:08
por sygecom
qual o caminho que está instalado seu BCC ? seu xHarbour ?
E post como está seus .CFG que ficam na pasta \BCC55\BIN
Re: Erro _stddef.h / assert.h
Enviado: 22 Mar 2010 21:44
por carlosdgs
Boa noite!!
Minha configuraçao :
Caminho do BCC - c:\bcc55
bcc32.CFG
-IC:\BCC55\INCLUDE;C:\XHARBOUR\INCLUDE
-LC:\BCC55\LIB;C:\XHARBOUR\LIB
Caminho do xHARBOUR - c:\xharbour
Grato!
Re: Erro _stddef.h / assert.h
Enviado: 22 Mar 2010 22:10
por sygecom
O outro .CFG está configurado corretamente ?
post o código que está querendo compilar.
Re: Erro _stddef.h / assert.h
Enviado: 23 Mar 2010 08:56
por carlosdgs
O outro .CFG esta assim : -LC:\BCC55\LIB;C:\xHARBOUR\LIB;C:\hwgui\LIB
E o códdigo que estou tentando compilar :
Código: Selecionar todos
#define _CLIPDEFS_H
#define HB_OS_WIN_USED
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapifs.h"
#include <stdio.h>
HB_FUNC( P_INITPORTSPEED )
{
DCB dcb;
char values[ 20 ];
LPTSTR lpValues;
FillMemory( &dcb, sizeof( dcb ), 0 );
dcb.DCBlength = sizeof( dcb );
hb_snprintf( values, sizeof( values ), "%lu,%1s,%1lu,%1lu", hb_parnl( 2 ), hb_parcx( 4 ), hb_parnl( 3 ), hb_parnl( 5 ) );
lpValues = HB_TCHAR_CONVTO( values );
if( BuildCommDCB( lpValues, &dcb ) )
{
if( SetCommState( ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 ), &dcb ) )
{
COMMTIMEOUTS timeouts;
/* read/write operations return immediatly */
timeouts.ReadIntervalTimeout = MAXDWORD;
timeouts.ReadTotalTimeoutMultiplier = 0;
timeouts.ReadTotalTimeoutConstant = 0;
timeouts.WriteTotalTimeoutMultiplier = 0;
timeouts.WriteTotalTimeoutConstant = 0;
hb_retnl( SetCommTimeouts( ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 ), &timeouts ) ? 0 : -1 );
}
else
hb_retnl( -1 );
}
else
hb_retnl( -1 );
HB_TCHAR_FREE( lpValues );
}
HB_FUNC( P_READPORT )
{
char buffer[ 512 ];
DWORD nRead = 0;
OVERLAPPED Overlapped;
memset( &Overlapped, 0, sizeof( OVERLAPPED ) );
if( ReadFile( ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 ), buffer, sizeof( buffer ), &nRead, &Overlapped ) )
hb_retclen( buffer, nRead );
else
hb_retc_null();
}
HB_FUNC( P_WRITEPORT )
{
DWORD nWritten = 0;
OVERLAPPED Overlapped;
memset( &Overlapped, 0, sizeof( OVERLAPPED ) );
if( WriteFile( ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 ), hb_parcx( 2 ), hb_parclen( 2 ), &nWritten, &Overlapped ) )
hb_retnl( ( long ) nWritten ); /* Put GetLastError() on error, or better a second byref param? */
else
hb_retnl( -1 );
}
HB_FUNC( P_INFREE )
{
HANDLE hPort = ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 );
COMMPROP CommProp;
if( GetCommProperties( hPort, &CommProp ) )
{
COMSTAT ComStat;
if( ClearCommError( hPort, NULL, &ComStat ) && CommProp.dwCurrentRxQueue != 0 )
hb_retnl( CommProp.dwCurrentRxQueue - ComStat.cbInQue );
else
hb_retnl( -1 );
}
else
hb_retnl( -1 );
}
HB_FUNC( P_OUTFREE )
{
HANDLE hPort = ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 );
COMMPROP CommProp;
if( GetCommProperties( hPort, &CommProp ) )
{
COMSTAT ComStat;
if( ClearCommError( hPort, NULL, &ComStat ) && CommProp.dwCurrentTxQueue != 0 )
hb_retnl( CommProp.dwCurrentTxQueue - ComStat.cbOutQue );
else
hb_retnl( -1 );
}
else
hb_retnl( -1 );
}
HB_FUNC( P_CTRLCTS )
{
hb_retni( 0 ); /* dummy */
}
HB_FUNC( P_ISDCD )
{
DWORD dwModemStat = 0;
BOOL bRet = GetCommModemStatus( ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 ), &dwModemStat );
hb_retl( bRet ? ( dwModemStat & MS_RLSD_ON ) != 0 : FALSE ); /* The RLSD (receive-line-signal-detect) signal is on. Also is DCD. */
}
HB_FUNC( P_ISRI )
{
DWORD dwModemStat = 0;
BOOL bRet = GetCommModemStatus( ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 ), &dwModemStat );
hb_retl( bRet ? ( dwModemStat & MS_RING_ON ) != 0 : FALSE );
}
HB_FUNC( P_ISDSR )
{
DWORD dwModemStat = 0;
BOOL bRet = GetCommModemStatus( ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 ), &dwModemStat );
hb_retl( bRet ? ( dwModemStat & MS_DSR_ON ) != 0 : FALSE );
}
HB_FUNC( P_ISCTS )
{
DWORD dwModemStat = 0;
BOOL bRet = GetCommModemStatus( ( HANDLE ) ( HB_PTRUINT ) hb_parnint( 1 ), &dwModemStat );
hb_retl( bRet ? ( dwModemStat & MS_CTS_ON ) != 0 : FALSE );
}
Grato!
Re: Erro _stddef.h / assert.h
Enviado: 23 Mar 2010 10:29
por sygecom
É tentei compilar aqui e nem compila, nesse caso nem sei como ajudar nesse codigo. Mas se serve como ajuda e se deseja usar funções para manipulação de porta Serial, procure pela Hbcomm, ou se poder compilar com Harbour tem a HBWIN(a melhor para comunicação serial) e em Fivewin tem também na versão Gratuita, podendo ser usada em aplicativos que usa Hwgui, Minigui e etc...
Re: Erro _stddef.h / assert.h
Enviado: 23 Mar 2010 11:46
por carlosdgs
Ok, Leonardo
Obrigado pela ajuda, vou estudar mais sobre isto..
Abraços