Page 2 of 4

Re: Error al compilar con HMG3.6

Posted: Mon Nov 25, 2024 8:12 pm
by jorge.posadas
EDK

Muchas gracias ya recompile bien tidi y ya no me da error.
Solo que ahora no me puedo conectar al servidor ni tampoco crear la base de datos ni tablas, tendré que ver como le hago,

Re: Error al compilar con HMG3.6

Posted: Mon Nov 25, 2024 10:20 pm
by edk
¿Qué versión del servidor MySQL tienes?

Re: Error al compilar con HMG3.6

Posted: Tue Nov 26, 2024 10:33 am
by serge_girard
Edward,

First compilation give this error:

Code: Select all

P:/hmg.3.6/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lssl: No such file or directory
P:/hmg.3.6/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcrypto: No such file or directory

I have this in my HBC-file:

Code: Select all

libs=hbssl
libs=libeay32
libs=ssleay32


I suppose C:\hmg.3.6\hmg64.hbc (P:\hmg.3.6\hmg64.hbc in my case) need some adjustments?

Serge

Re: Error al compilar con HMG3.6

Posted: Tue Nov 26, 2024 1:30 pm
by serge_girard
Edward, How about UNICODE? It got my program compiled (SSL stuff in REMARK) and now it works but my SQL results with french accents (ç .. ë è ..) are unreadable....

Serge

Re: Error al compilar con HMG3.6

Posted: Tue Nov 26, 2024 3:31 pm
by jorge.posadas
EDK

Realmente uso MARIADB 11.5

Re: Error al compilar con HMG3.6

Posted: Tue Nov 26, 2024 5:55 pm
by serge_girard
Jorge,
I think this will not be a problem!
Serge

Re: Error al compilar con HMG3.6

Posted: Wed Nov 27, 2024 9:51 pm
by edk
jorge.posadas wrote: Tue Nov 26, 2024 3:31 pm EDK

Realmente uso MARIADB 11.5
For the MariaDB server, you need to build hbmysql in a slightly different way.
Specify the location of the MariaDB SQL server installation instead of MySQL and use the libmariadb.dll library by renaming it to libmysql.dll
Here is configuration for MariaDB 11.5:

Code: Select all

SET HB_WITH_MYSQL=c:\Program Files\MariaDB 11.5\include\mysql
Copy the c:\Program Files\MariaDB 11.5\lib\libmariadb.dll library to the folder where your application is located, renaming the file to libmysql.dll

Re: Error al compilar con HMG3.6

Posted: Thu Nov 28, 2024 9:52 am
by edk
serge_girard wrote: Tue Nov 26, 2024 10:33 am Edward,

First compilation give this error:

Code: Select all

P:/hmg.3.6/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lssl: No such file or directory
P:/hmg.3.6/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcrypto: No such file or directory

I have this in my HBC-file:

Code: Select all

libs=hbssl
libs=libeay32
libs=ssleay32


I suppose C:\hmg.3.6\hmg64.hbc (P:\hmg.3.6\hmg64.hbc in my case) need some adjustments?

Serge
Hi Serge.
There are no SSL libraries, so we have to build them. We proceed in a similar way as with hbmysql.

Preparing OpenSSL v.3:

Download the Win64 OpenSSL v3.4.0 EXE installer ( 64-bit! ) from the website https://slproweb.com/products/Win32OpenSSL.html
Run the downloaded installer and install OpenSSL to the C:\OpenSSL-Win64-3.4.0 folder, when asked where to copy the OpenSSL DLLS indicate "The OpenSSL binaries (/bin) directory"

Building the hbssl library:

As with the missing hbmysql, we need to have the harbour sources. The hbssl sources are located in the core-master\contrib\hbssl\ folder. Copy the hbssl folder to c:\hmg.3.6\harbour64\contrib\ (in your case it would be P:\hmg.3.6\harbour64\contrib\ )
In the copied folder, create a batch file build_hbssl.bat

Code: Select all

@echo off
SET backup=%path%
SET HB_WITH_OPENSSL=C:\OpenSSL-Win64-3.4.0\include
SET HMGPATH=c:\hmg.3.6
SET PATH=%HMGPATH%\harbour64\bin;%HMGPATH%\mingw64\bin;%PATH%
hbmk2 hbssl.hbp -i%hmgpath%\include
ROBOCOPY .\ %HMGPATH%\HARBOUR64\lib\win\mingw64\ *.a
set path=%backup%
set backup=
pause
* in the HMGPATH variable we define the path where our HMG 3.6 is installed (in your case it would be P:\hmg.3.6)
* in the HB_WITH_OPENSSL variable we define the path where OpenSSL 3 is installed

Modification of hbssl.hbc for OpenSSL 3 library:

In OpenSSL 3 the names of the library files have changed, so you need to edit the file c:\hmg.3.6\harbour64\contrib\hbssl.hbc to the following notations:

Code: Select all

description=OpenSSL wrapper (encryption)

# NOTE: use HB_STATIC_OPENSSL=yes envvar to link openssl lib statically

incpaths=.

headers=${hb_name}.ch

skip={dos}

{!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)}libs=${_HB_DYNPREF}${hb_name}${_HB_DYNSUFF}
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)}libs=${_HB_DYNPREF}${hb_name}s${_HB_DYNSUFF}

{!HB_DYNBIND_OPENSSL&unix}libs=ssl crypto
{!HB_DYNBIND_OPENSSL&os2}libs=libssl_s libcrypto_s
{!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)&win&!allmingw}libs=ssleay32 libeay32
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&win&!allmingw}libs=ssleay32 libeay32
#{!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=ssl crypto
#{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=ssl crypto
{!HB_DYNBIND_OPENSSL&!(HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=libssl-3-x64 libcrypto-3-x64
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&allmingw}libs=libssl-3-x64 libcrypto-3-x64
{!HB_DYNBIND_OPENSSL& (HB_STATIC_OPENSSL&!hbdyn)&allwin}libs=crypt32
We build the hbssl library by running the build_hbssl.bat file.

That's all.

In this version of hbssl with OpenSSL 3, no external .dll libraries are required, because they are imported into the liblibcrypto-3-x64.a and liblibssl-3-x64.a libraries, so they will be included in the application executable 8-)

If you compile using an IDE, put the following in the configuration:

Code: Select all

libs=hbssl
libs=libssl-3-x64
libs=libcrypto-3-x64
or simpler, it is enough to do the following:

Code: Select all

hbcs=hbssl.hbc
(must be .hbc extension)

If you compile using a build64.bat, add the following to .hbp file in your project:

Code: Select all

hbssl.hbc

Re: Error al compilar con HMG3.6

Posted: Thu Nov 28, 2024 12:39 pm
by serge_girard
Thanks, this SSL-thing will be something for tomorrow...
Serge

Re: Error al compilar con HMG3.6

Posted: Wed Dec 11, 2024 6:38 pm
by mjaviergutierrez
Hola Colegas ! Estoy tratando de compilar en 64 bits, usando libmysql.dll, hice todos los paso del PDF para la integracion de MySQL con HMG 3.6., pero al compilar desde el IDE me sale este error :

hbmk2[Motel]: Warning: Cannot find hbmysql=hbmysql.hbc (referenced from
C:\hmg.3.6\hmg64.hbc)
hbmk2: Linking... Motel.exe
C:/hmg.3.6/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: .hbmk/win/mingw64/Main.o:Main.c:(.data+0xa30): undefined reference to `HB_FUN_TMYSQLSERVER'
collect2.exe: error: ld returned 1 exit status
hbmk2[Motel]: Error: Running linker. 1
gcc.exe .hbmk/win/mingw64/Main.o .hbmk/win/mingw64/Administracion.o .hbmk/win/mingw64/Caja.o .hbmk/win/mingw64/Configuracion.o .hbmk/win/mingw64/Inicio.o .hbmk/win/mingw64/Mucamas.o .hbmk/win/mingw64/Recepcion.o .hbmk/win/mingw64/Shared.o .hbmk/win/mingw64/_hbmkaut_Main.o C:/Work/temp/_temp.o -pthread -static-libgcc -static-libstdc++ -static -lpthread -mwindows -Wl,--start-group -l"hmg-64" -l"crypt-64" -l"edit-64" -l"editex-64" -l"graph-64" -l"ini-64" -l"report-64" -l"hfcl-64" -lmsvfw32 -lvfw32 -l"hbvpdf-64" -lhbct -lhbwin -lhbmzip -lminizip -lhbmemio -lhbmisc -lhbtip -lsqlite3 -lhbsqlit3 -lsddodbc -lrddsql -lhbodbc -lodbc32 -lhbhpdf -lhbnetio -lxhb -lpng -llibhpdf -lhbzebra -lsoftail -lhbextern -lhbdebug -lhbvmmt -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainwin -lwinmm -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -oMotel.exe -LC:/hmg.3.6/harbour64/lib/win/mingw64 -L"C:/hmg.3.6/lib-64"

hbmk2: Hint: Add option 'hbmysql.hbc' for missing function(s): TMySQLServer()


le di varias vueltas, pero no consigo entender ......... Ayuda !

Saludos.