xHarbour 64 bits y xbScritp - (Solucionado)

xHarbour 64 bits y xbScritp - (Solucionado)

Postby Cgallegoa » Fri Sep 13, 2024 2:44 am

Hola a todos.

Estoy intentando moverme hacia FWH 64b pero me encuentro con una fuerte limitante y ya le he dado la vuelta por todos los lados sin encontrar solución.

La mayoría de mis programas hacen uso al máximo de la opción de procesar scripts en tiempo de ejecución por medio de xBscripts.prg, que viene en la carpeta "utils\xbscript" de xHarbour, sin ningún tipo de limitación, siempre y cuando utilice sintaxis de código preprocesado.. Es decir, puedo hacer una aplicación del tamaño que sea, con todo su código abierto y que se procese en tiempo de ejecución. El Exe prinicipal sólo tendria unas pocas líneas como variables, algunos REQUEST o EXTERN, etc. y la llamada al script principal. Es realmente poderosa, y la razón por la cual no me moví hacia Harbour, que también lo puede hacer, es que me tocaba cambiar mucho código, además de que con xHarbour no tengo ningún inconveniente.

Hasta ahora, con los 64 bits. El tren se frenó en seco. Le he dado la vuelta a la tuerca por todos los lados y no consigo compilar xbScript.prg para generar la librería, que es lo que he hecho siempre. o para linkearlo directamente con el código del ejercicio de prueba, pero me quedó grande. El condenado insiste en que no se encuentra el archivo "hbvmpub.h" y resulta que si está. He pedido ayuda a ChatpGPT, Gémini y Claude, y nada. El archivo está, las rutas están bien, los scripts de compilación están bien pero no logro generar la librería. O algo me falta o estoy haciendo mal, o o se metió un duende en mi computador.

Alguna idea, o definitivemente no se puede usar dicha prestación en xHarbour 64bits, lo que sería un desastre. O existe alguna alternativa en xHarbour64 bits que haga lo mismo que xbScript en xHarbour 32 bits ?

Alguno de los que ya están en 64 bits y usan xHarbour, han hecho algo al respecto ?

Gracias y un abrazo,
Last edited by Cgallegoa on Mon Sep 16, 2024 7:18 pm, edited 1 time in total.
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 463
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: xHarbour 64 bits y xbScritp

Postby Antonio Linares » Fri Sep 13, 2024 4:00 am

Estimado Carlos,

Usas bcc77 64 bits ?

Cómo lo estás construyendo ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xHarbour 64 bits y xbScritp

Postby Antonio Linares » Fri Sep 13, 2024 4:20 am

Carlos,

Asi se compila bien, situado en c:\xharbour\utils\xbscript\:
c:\xharbour64\bin\harbour -n -I..\..\include xbscript.prg

y a continuación:

set path=c:\bcc7764\bin
bcc64 -c -I..\..\include xbscript.c

el obj se construye correctamente, salvo que por defecto usa .o en vez de .obj, pero puedes renombrarlo
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xHarbour 64 bits y xbScritp

Postby Cgallegoa » Fri Sep 13, 2024 8:29 pm

Antonio,

Ya pude generar a librería pero ahora tengo error al momento de linkearla a un prg:

Turbo Incremental Link64 6.98 Copyright (c) 1997-2023 Embarcadero Technologies, Inc.
Error: Unresolved external 'HB_FUN_DLLPREPARECALL' referenced from C:\XHARBOUR64\UTILS\XBSCRIPT\XBSCRIPT.A|xbscript.o
Error: Unresolved external 'HB_FUN_GETPROCADDRESS' referenced from C:\XHARBOUR64\UTILS\XBSCRIPT\XBSCRIPT.A|xbscript.o
Error: Unresolved external 'HB_FUN_DLLEXECUTECALL' referenced from C:\XHARBOUR64\UTILS\XBSCRIPT\XBSCRIPT.A|xbscript.o
Error: Unresolved external 'HB_FUN_DLLCALL' referenced from C:\XHARBOUR64\UTILS\XBSCRIPT\XBSCRIPT.A|xbscript.o

Esas cuatro funciones no están en xHarbour 64, ultima versión (1.3.1. - Build 20240624)
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 463
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: xHarbour 64 bits y xbScritp

Postby Antonio Linares » Sat Sep 14, 2024 9:13 am

Carlos,

Se lo reporto a Enrico

gracias!
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xHarbour 64 bits y xbScritp

Postby Enrico Maria Giordano » Sat Sep 14, 2024 12:15 pm

xHarbour's dllcall.c is not currently compatible with 64 bit. You better build xbscript using xHarbour 32 bit.
User avatar
Enrico Maria Giordano
 
Posts: 8512
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHarbour 64 bits y xbScritp

Postby Antonio Linares » Sat Sep 14, 2024 12:21 pm

Dear Enrico,

Wouldn't it have more sense to make dllcall.c 64 bits compatible ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xHarbour 64 bits y xbScritp

Postby Cgallegoa » Sat Sep 14, 2024 6:16 pm

I agree, making dllcall.c 64-bit compatible is the ideal solution. Additionally, linking a 32-bit "xbscript.lib" with a 64-bit program is not possible, correct?
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 463
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: xHarbour 64 bits y xbScritp

Postby Enrico Maria Giordano » Sat Sep 14, 2024 6:34 pm

Antonio Linares wrote:Dear Enrico,

Wouldn't it have more sense to make dllcall.c 64 bits compatible ?


Of course, but who can do that?
User avatar
Enrico Maria Giordano
 
Posts: 8512
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHarbour 64 bits y xbScritp

Postby Enrico Maria Giordano » Sat Sep 14, 2024 9:19 pm

I can try to fix it but first I need a very little PRG sample using the function inside dllcall.c. Can you provide one, please?
User avatar
Enrico Maria Giordano
 
Posts: 8512
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHarbour 64 bits y xbScritp

Postby Cgallegoa » Sat Sep 14, 2024 10:06 pm

Hello Enrico, thank you for your help.

This is an example of its practical use:
https://forums.fivetechsupport.com/viewtopic.php?f=6&t=44868&sid=b80abcbc51c4cae175dee5944ccb5618

I build the library from these files in c:\xharbour\utils\xbscript:
clresults.ch
xbs_harb.ch
xbsclass.ch
xbscript.prg


Using this batch, make:lib.bat:
@ECHO ****** Genera archivos C ******
C:\XHARBOUR64\BIN\Harbour xbscript /n /p /i%C:\FWH64\INCLUDE;C:\XHARBOUR64\INCLUDE;C:\BORLAND7764\INCLUDE% -D__HARBOUR__ > LOGFILE.TXT
IF ERRORLEVEL 1 GOTO ERROR >> LOGFILE.TXT
ECHO *************** Todo bien *************** >> LOGFILE.TXT
ECHO... >> LOGFILE.TXT

@ECHO ****** Con los archivos C genera los archivos obj ******
C:\BORLAND7764\BIN\BCC64.EXE -M -c -O2 -D__HARBOUR__;HB_API_MACROS;HB_FM_STATISTICS_OFF -I%C:\FWH64\INCLUDE;C:\XHARBOUR64\INCLUDE;C:\BORLAND7764\INCLUDE% -tW xbscript.c >> LOGFILE.TXT
IF ERRORLEVEL 1 GOTO ERROR >> LOGFILE.TXT
ECHO *************** Todo bien *************** >> LOGFILE.TXT

@ECHO ****** Genera Libreria RPREVIEW.LIB ******
if exist xbscript.lib del xbscript.lib
TLIB XBSCRIPT.LIB +-xbscript.obj >> LOGFILE.TXT

DEL XBSCRIPT.c
rem DEL XBSCRIPT.obj
rem DEL .obj
IF ERRORLEVEL 1 GOTO ERROR >> LOGFILE.TXT
ECHO *************** Todo bien *************** >> LOGFILE.TXT
GOTO EXIT >> LOGFILE.TXT
:ERROR >> LOGFILE.TXT
ECHO *************** Hay errores *************** >> LOGFILE.TXT
GOTO EXIT >> LOGFILE.TXT
:EXIT >> LOGFILE.TXT
DEL *.ppo

I’ve always done it this way, for 32 bits, without any problems, for over 10 years. Now I want to do it for 64 bits. :D
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 463
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: xHarbour 64 bits y xbScritp

Postby Enrico Maria Giordano » Sun Sep 15, 2024 6:43 am

Sorry, I need a little PRG example for the functions contained in dllcall.c (DLLPREPARECALL(), etc.), not for xbscript.
User avatar
Enrico Maria Giordano
 
Posts: 8512
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHarbour 64 bits y xbScritp

Postby Cgallegoa » Sun Sep 15, 2024 1:49 pm

Hi Enrico,

I don't make any direct calls to any of the four functions. It is in the xbscript.c file, which is generated when building the library, where the calls appear:
HB_FUNC_EXTERN( DLLPREPARECALL );
HB_FUNC_EXTERN( GETPROCADDRESS );
HB_FUNC_EXTERN( DLLEXECUTECALL );
HB_FUNC_EXTERN( DLLCALL );

If I generate the executable of a simple program without linking the "xbscript.a" library (generated with xHarbour 64 and Borland 7.7 64), everything works perfectly. However, if I link the xbscript library, the error occurs.

This is how I generate the library:
Code: Select all  Expand view
c:\xharbour64\bin\harbour -n -I..\..\include xbscript.prg
set path=c:\borland7764\bin
bcc64 -c -I..\..\include xbscript.c
tlib64 xbscript +-xbscript.o

Best regards,
Saludos,

Carlos Gallego

*** FWH-24.07, xHarbour 1.3.1 Build 20240624, Borland C++7.70, PellesC ***
Cgallegoa
 
Posts: 463
Joined: Sun Oct 16, 2005 3:32 am
Location: Quito - Ecuador

Re: xHarbour 64 bits y xbScritp

Postby Enrico Maria Giordano » Sun Sep 15, 2024 6:00 pm

Yes, I know, but I need a sample for those functions. Otherwise I cannot help you, sorry. Anybody can provide such a sample?
User avatar
Enrico Maria Giordano
 
Posts: 8512
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: xHarbour 64 bits y xbScritp

Postby Antonio Linares » Sun Sep 15, 2024 6:08 pm

Dear Enrico,

In xharbour's repo dllcall.c module there is:

#if defined( __WIN32__ ) && ! defined( __WIN64__ )

why is it not included for WIN64 ?

Could you please comment out such line and rebuild in 64 bits ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 24 guests