FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour xHarbour 64 bits y xbScritp - (Solucionado)
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
xHarbour 64 bits y xbScritp - (Solucionado)
Posted: Fri Sep 13, 2024 02: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,

Saludos,



Carlos Gallego



*** FWH-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xHarbour 64 bits y xbScritp
Posted: Fri Sep 13, 2024 04:00 AM

Estimado Carlos,

Usas bcc77 64 bits ?

C贸mo lo est谩s construyendo ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xHarbour 64 bits y xbScritp
Posted: Fri Sep 13, 2024 04: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
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: xHarbour 64 bits y xbScritp
Posted: Fri Sep 13, 2024 08: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-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xHarbour 64 bits y xbScritp
Posted: Sat Sep 14, 2024 09:13 AM

Carlos,

Se lo reporto a Enrico

gracias!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHarbour 64 bits y xbScritp
Posted: 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.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xHarbour 64 bits y xbScritp
Posted: 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
Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: xHarbour 64 bits y xbScritp
Posted: Sat Sep 14, 2024 06: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-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHarbour 64 bits y xbScritp
Posted: Sat Sep 14, 2024 06: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?
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHarbour 64 bits y xbScritp
Posted: Sat Sep 14, 2024 09: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?

Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: xHarbour 64 bits y xbScritp
Posted: 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鈥檝e 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-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHarbour 64 bits y xbScritp
Posted: Sun Sep 15, 2024 06:43 AM

Sorry, I need a little PRG example for the functions contained in dllcall.c (DLLPREPARECALL(), etc.), not for xbscript.

Posts: 514
Joined: Sun Oct 16, 2005 03:32 AM
Re: xHarbour 64 bits y xbScritp
Posted: Sun Sep 15, 2024 01: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 (fw): Select all Collapse
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-25.12, xHarbour 1.3.1 Build 20241008, Borland C++7.70, PellesC, ADS 11.1***

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: xHarbour 64 bits y xbScritp
Posted: Sun Sep 15, 2024 06: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?

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: xHarbour 64 bits y xbScritp
Posted: Sun Sep 15, 2024 06: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