Page 1 of 1

MongoDb

PostPosted: Sat May 12, 2018 2:22 pm
by horacio
Colegas, estoy trabajando con la base de datos MongoDb con Node Js. Me gustaría poder conectarme con una aplicación de escritorio FWH-Harbour. En https://github.com/tfonrouge/hbmongoc encontré un driver escrito en C pero al intentar compilarlo obtengo varios errores. Alguien lo ha podido compilar y me eche una mano ? Muchísimas gracias.

Saludos

Re: MongoDb

PostPosted: Sat May 12, 2018 2:54 pm
by cnavarro
Horacio, estoy buscando un rato para probarlo desde hace tiempo, pero qué errores te da?

Re: MongoDb

PostPosted: Sat May 12, 2018 3:15 pm
by horacio
Hola Cristóbal, en las fuentes que bajé no encontré "bson.h", la encontré en google. Al compilar me salen estos errores en ese módulo

Code: Select all  Expand view

Error directive:  Must compile with c99 or define MONGO_HAVE_STDINT, MONGO_HAVE_UNISTD, MONGO_USE__INT64, or MONGO_USE_LONG_LONG_INT.
 


Si lo pongo comentariado obtengo estos errores en hb_bson.h

Code: Select all  Expand view

typedef enum
{
    _hbbson_t_,
    _hbbson_oid_t_,
    _hbbson_iter_t_,
    _hbbson_context_t_,
#if BSON_CHECK_VERSION( 1, 5, 0 )   /*ERROR*/
    _hbbson_decimal128_t_
#endif
} hbbson_t_;

typedef struct _HB_BSON_
{
    hbbson_t_ hbbson_type;
    void * p;
} HB_BSON, * PHB_BSON;

bson_context_t *    bson_context_hbparam( int iParam );  /*ERROR*/
#if BSON_CHECK_VERSION( 1, 5, 0 )                                 /*ERROR*/
bson_decimal128_t * bson_decimal128_hbparam( int iParam ); /*ERROR*/
#endif
bson_t *            bson_hbparam( int iParam, long lMask );  /*ERROR*/
void                bson_hbstor_byref_error( int iParam, bson_error_t * error, HB_BOOL valid ); /*ERROR*/
bson_iter_t *       bson_iter_hbparam( int iParam );                          /*ERROR*/
bson_oid_t *        bson_oid_hbparam( int iParam );
bson_t *            get_bson_item(PHB_ITEM pItem);                           /*ERROR*/
char *              hbbson_as_json( const bson_t * bson );                    /*ERROR*/
PHB_BSON            hbbson_new_dataContainer( hbbson_t_ hbbson_type, void * p );
PHB_BSON            hbbson_param( int iParam, hbbson_t_ hbbson_type );
HB_LONGLONG         hb_dtToUnix(double dTimeStamp);

#endif /* hb_bson_h */
 


Saludos

Re: MongoDb

PostPosted: Sat May 12, 2018 5:48 pm
by cnavarro
Horacio, en qué entorno lo estás intentando generar?
Creo haber leído que es solo para 64 bits ( aunque no estoy seguro al 100% )

Re: MongoDb

PostPosted: Sat May 12, 2018 8:35 pm
by horacio
Lo pensé, estoy compilando con bcc7 y harbour en 32 bits. Una pena. Gracias por la ayuda

Saludos