xml

xml

Postby Verhoven » Tue Mar 05, 2019 8:39 am

Necesito intercambiar mensajes mediante xml.

Para ello estoy revisando el foro y he tratado de probar con mxml pero no logro compilar.
En el prg he incorporado la línea: #include "hbmxml.ch"
Teniendo que descargar el fichero de cabecera de internet porque no lo encuentro ni en los directorios de harbour ni en los de fw.

Y en la lista de librerías de harbour he probado alternativamente con:
1.- Para 32 bits con:
hbmxml.lib
hbmxml-bcc.lib
Code: Select all  Expand view
Compiling...
Harbour 3.2.0dev (r1412151448)
Copyright (c) 1999-2014, http://harbour-project.org/
Compiling 'wintpv.prg' and generating preprocessed output to 'wintpv.ppo'...
Lines 49411, Functions/Procedures 583
Generating C source output to 'wintpv.c'... Done.
Embarcadero C++ 7.00 for Win32 Copyright (c) 1993-2015 Embarcadero Technologies, Inc.
wintpv.c:
Turbo Incremental Link 6.70 Copyright (c) 1997-2014 Embarcadero Technologies, Inc.
Fatal: Too many DEF file names: C:\harbour\lib\hbmxml.lib
* Linking errors *
No se pudo encontrar c:\CLIWIN\FW\wintpv.tds
No se pudo encontrar c:\CLIWIN\FW\wintpv.map



2.- Para 64 bits con:
hbmxml.lib
hbmxml-x64.lib

Al terminar la compilación me da el siguiente error:

Code: Select all  Expand view
Compiling...
Harbour 3.2.0dev (r1412151448)
Copyright (c) 1999-2014, http://harbour-project.org/
Compiling 'wintpv.prg' and generating preprocessed output to 'wintpv.ppo'...
Lines 49041, Functions/Procedures 583
Generating C source output to 'wintpv.c'... Done.
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

wintpv.c
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17298
Copyright (C) Microsoft Corporation.  All rights reserved.

wintpv.obj : error LNK2001: unresolved external symbol HB_FUN_MXMLLOADSTRING
wintpv.obj : error LNK2001: unresolved external symbol HB_FUN_MXMLGETTYPE
wintpv.obj : error LNK2001: unresolved external symbol HB_FUN_MXMLGETELEMENT
wintpv.obj : error LNK2001: unresolved external symbol HB_FUN_MXMLGETOPAQUE
wintpv.obj : error LNK2001: unresolved external symbol HB_FUN_MXMLWALKNEXT
wintpv.obj : error LNK2001: unresolved external symbol HB_FUN_MXMLSAVEALLOCSTRING
wintpv.obj : error LNK2001: unresolved external symbol HB_FUN_MXMLDELETE
wintpv_64.EXE : fatal error LNK1120: 7 unresolved externals
* Linking errors *


Les ruego me indiquen alguna sugerencia para solventar el problema.
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: xml

Postby Verhoven » Fri Mar 08, 2019 6:37 pm

Tratemiento de ficheros XML.
Me respondo a mi mismo, por si le puede servir a alguien más dado lo enredoso para llegar a la solución y el tiempo empleado.

Primero debéis descargar Harbour (actualmente la versión 3.2) directamente de su web, en concreto el archivo: harbour-nightly-win.exe de la web: https://sourceforge.net/projects/harbour-project/files/binaries-windows/nightly/
Una vez descargado lo instalais, colocándolo por ejemplo en la carperta C:\hb32, CON CUIDADO DE QUE NO TENGAIS UNA IGUAL QUE ESTÉ EN USO para no machacarla.
Esto es para conseguir los dos ficheros de cabecera .ch que deberéis de incluir en vuestros programas. En concreto los ficheros:
hbxml.ch
hbmxml.ch
Que no vienen en los harbour que traen mis versiones de FW, ni la de 32 bits ni la de 64.

Segundo, en los archivos .bat (si usais este método para compilar y linkar) agregar las dos librerías siguientes:
hbmxml.lib
mxml.lib
Que, en mi caso, si que vienen con el harbour que incorporan mis versiones de FW.

Para 32 bits (con BCC):
Code: Select all  Expand view
echo %hdirl%\hbmxml.lib + >> b32.bc
echo %hdirl%\mxml.lib + >> b32.bc

Siendo %hdirl% en mi caso: C:\harbour\lib (Estas dos librerías si vienen en el Harbour que acompaña a mi versión de fw)

Para 64 bits ((MSVC++) Ago.2014 ):
Code: Select all  Expand view
echo %hdirl%\hbmxml.lib >> msvc.tmp
echo %hdirl%\mxml.lib >> msvc.tmp

Siendo %hdirl% en mi caso: C:\harbour64\lib (Estas dos librerías si vienen en el Harbour que acompaña a mi versión de fw)


Tercero, además en el código fuente de vuestros programas hay que agregar:
Code: Select all  Expand view
//Para tratamiento de ficheros XML
#include "C:\hb32\contrib\xhb\hbxml.ch"
#include "C:\hb32\contrib\hbmxml.ch""


Saludos.
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

Re: xml

Postby Verhoven » Fri Mar 08, 2019 6:44 pm

Corrijo una errata del punto tercero:
En vez de añadir a vuestros fuentes las líneas que ponía en el tercer punto anterior añadir estas:

Code: Select all  Expand view
//Para tratamiento de ficheros XML
#include "C:\hb32\contrib\xhb\hbxml.ch"
#include "C:\hb32\contrib\hbmxml\hbmxml.ch"
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 80 guests