Compilando Winsock.c

Post Reply
User avatar
Vikthor
Posts: 271
Joined: Fri Oct 07, 2005 5:20 am
Location: México

Compilando Winsock.c

Post by Vikthor »

Antonio :

Me podrías decir cuales son los flags correspondientes para compilar correctamente el programa Winsock.c.
Vikthor
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Victor,

-DARM -DUNICODE -D__HARBOUR__ -DHB_API_MACROS -D__FLAT__

y primero tienes que llamar a tools\clp2harb.exe para que adapte el fichero C a formato compatible con Harbour.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Vikthor
Posts: 271
Joined: Fri Oct 07, 2005 5:20 am
Location: México

Post by Vikthor »

Antonio Linares wrote:Victor,

-DARM -DUNICODE -D__HARBOUR__ -DHB_API_MACROS -D__FLAT__

y primero tienes que llamar a tools\clp2harb.exe para que adapte el fichero C a formato compatible con Harbour.
Antonio :
Gracias por la respuesta
Y aprovechando que es gerundio, de dónde puedo bajar clp2harb.exe
Vikthor
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Victor,

Lo tienes en el directorio fwh\tools
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Vikthor
Posts: 271
Joined: Fri Oct 07, 2005 5:20 am
Location: México

Post by Vikthor »

Antonio Linares wrote:Victor,

Lo tienes en el directorio fwh\tools
Antonio :

Agregue los flag que me comentaste y al momento de compilar me devuelve estos errores.

Code: Select all


TSOCKET.c
clarm.exe -TP -W3 -c -DARM -DUNICODE-D__HARBOUR__-DHB_API_MACROS-D__FLAT__ -IC:\harbourc\include;c:\fwppc\Include -Ic:\FWPPC\INCLUDE -IC:\harbourc\Include -IC:\vce\Include\arm winsock.c
Microsoft (R) C/C++ Optimizing Compiler Version 12.20.9615 for ARM
Copyright (C) Microsoft Corp 1984-2002. All rights reserved.

c:\fwppc\source\winapi\winsock.c(185) : error C2664: '_bset' : cannot convert parameter 1 from 'char *' to 'unsigned char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\fwppc\source\winapi\winsock.c(276) : error C2065: '_send' : undeclared identifier
c:\fwppc\source\winapi\winsock.c(305) : error C2664: '_bset' : cannot convert parameter 1 from 'char *' to 'unsigned char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\fwppc\source\winapi\winsock.c(339) : error C2664: '_bset' : cannot convert parameter 1 from 'char *' to 'unsigned char *'
        Types pointed to are unrelated; conversion requires c:\fwppc\source\winapi\winsock.c(386) : error C2664: '_bset' : cannot convert parameter 1 from 'char *' to 'unsigned char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\fwppc\source\winapi\winsock.c(404) : error C2664: '_bset' : cannot convert parameter 1 from 'char *' to 'unsigned char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Y este el cógio fuente del primer error

Code: Select all

#ifdef __HARBOUR__
    HARBOUR HB_FUN_BINDTOPORT( PARAMS )   // nSocket, nPort, nAddr1, nAddr2, nAddr3, nAddr4 --> lSuccess
#else
    HB_FUN_BINDTOPORT( PARAMS )   // nSocket, nPort, nAddr1, nAddr2, nAddr3, nAddr4 --> lSuccess
#endif
{
   SOCKADDR_IN sa; // sockaddr_in sa;

   _bset( ( char * ) &sa, 0, sizeof( sa ) );

   sa.sin_family       = AF_INET;
   sa.sin_port         = htons( _parni( 2 ) );
/*
   sa.sin_addr.s_net   = _parni( 3 );
   sa.sin_addr.s_host  = _parni( 4 );
   sa.sin_addr.s_lh    = _parni( 5 );
   sa.sin_addr.s_impno = _parni( 6 );
 */
   sa.sin_addr.s_addr  = htonl( INADDR_ANY );

   _retl( bind( _parni( 1 ), ( SOCKADDR * ) &sa, sizeof( sa ) ) == 0 );
}
Vikthor
Post Reply