HMG 3.0.36 (Test)

HMG announcements; Latest HMG-related news, releases, fixes and updates.

Moderator: Rathinagiri

User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMG 3.0.36 (Test)

Post by Rathinagiri »

Ok. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 3.0.36 (Test)

Post by Roberto Lopez »

rathinagiri wrote:Ok. :)
I'm being successfull 'cleaning' hmg.hbc' file and it is 'human-readable' now, except for the following:

Code: Select all

libs=${hb_name}${__HB_DYN__}
Do you (or someone else) remember from where it come and what is its purpose?

TIA.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
apais
Posts: 440
Joined: Fri Aug 01, 2008 6:03 pm
DBs Used: DBF
Location: uruguay
Contact:

Re: HMG 3.0.36 (Test)

Post by apais »

AFAIR It's used to link dynamic libs (dll) to the program.
ref:

2010-07-31 01:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
...
* contrib/hbmzip/hbmzip.hbc
* contrib/hbxbp/hbxbp.hbc
* contrib/hbnetio/hbnetio.hbc
+ Added experimental support to request libs in dynamic (.dll) flavour.
Currently this can be enabled by setting envvar: __HB_DYN__=_dll
To make this work one has to build all contribs using HB_BUILD_CONTRIB_DYN=yes
beforehand.
Angel Pais
Web Apps consultant/architect/developer.
HW_apache (webserver modules) co-developer.
HbTron (Html GUI for harbour desktop hybrid apps) co-developer.
https://www.hbtron.com
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 3.0.36 (Test)

Post by Roberto Lopez »

apais wrote:AFAIR It's used to link dynamic libs (dll) to the program.
<...>
It's very stange, since if I remove it, I'm not able to build apps (I get lots of undefined references)...
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 3.0.36 (Test)

Post by Roberto Lopez »

rathinagiri wrote:Ok. :)
Mysql is broken in .36.

When I try to build a mysql application I get these error from the linker:
undefined reference to mysql_ping@4
and
undefined reference to mysql_real_escape_string@16
These kind of errors arises when libhbmysql and libmysql were created from different mysql header files.

Had you noticed about that/fixed?
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMG 3.0.36 (Test)

Post by Rathinagiri »

Hi Roberto,
Do you (or someone else) remember from where it come and what is its purpose?
It comes from HMG 4's hmg.hbc.

No. I am also couldn't connect MySQL server. For me it had shown that libmysql is not found.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 3.0.36 (Test)

Post by Roberto Lopez »

rathinagiri wrote:Hi Roberto,
Do you (or someone else) remember from where it come and what is its purpose?
It comes from HMG 4's hmg.hbc.
I mean, who contributed (created) the file. He has the answer I'm looking for.

I insist with this, because I do not like (and isn't good at all) having something there that we don't understand.
rathinagiri wrote: No. I am also couldn't connect MySQL server. For me it had shown that libmysql is not found.
If you instruct hbmk2 to link the two involved libraries (libmysql and libhbmysql) the libraries are found and the error shown by the linker is the one I've posted.

Here are the instructions I've created to guide the users to solve this problem and published along mysql samples:
To run this sample you need MySql client library:

- libmySQL.dll

This library is inluded in MySql distribution (http://www.mysql.com)

libmysql.a (located at \hmg\harbour\lib) must be built from libmySQL.dll
and libmySQL.def files (included in your MySql installation) using dlltool
utility (located at \hmg\mingw\bin) with the following command:

dlltool --input-def libmySQL.def --dllname libmySQL.dll --output-lib libmySQL.a -k

libmysql.a file included in this hmg distribution was created from libmysql.def
and libmysql.dll from X.X.XX version.
To be more clear...

hbmysql Harbour library is built using an Mysql include file ("mysql.h").

You can check this lookking at harbour/contrib/hbmysql.

In the line #75 of mysql.c you'll find:

Code: Select all

#include "mysql.h"
The bottom line is:

You must build libmysql using the same version of mysql.h used to build libhbmysql.

That information must be included in Harbour binaries. If not, we should ask in Harboue developers list.

You should try this youself to be able to solve the problem when I'm not here :)

I'll try anyway :)
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 3.0.36 (Test)

Post by Roberto Lopez »

The MySql version used to build libhbmysql in current SVN binaries is 5.5.13.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: HMG 3.0.36 (Test)

Post by Roberto Lopez »

Rathi,

We finally have a nice, clean and beautiful hmg.hbc file :)

This is it:

Code: Select all

# paths

incpaths=/.
incpaths=include
libpaths=lib

# main hmg libs

libs=hmg
libs=crypt
libs=edit
libs=editex
libs=graph
libs=hfcl
libs=hmgmysql
libs=hmgpgsql
libs=hmgsqlite
libs=ini
libs=report

# system

libs=msvfw32
libs=vfw32

# harbour contrib

libs=hbct
libs=hbwin
libs=hbmzip
libs=minizip
libs=hbmemio
libs=hbmisc
libs=hbmysql
libs=mysql
libs=hbtip
libs=sqlite3

Please, check it. Maybe I've forgot some library.

Note that libraries are directly invoked now, so we will not need .hbc contrib files for any of them.

This is the brand new, simplified build.bat:

Code: Select all

@echo off

rem ******************************************************************************
rem DELETE FILES FROM PREVIOUS BUILD
rem ******************************************************************************

if exist build.log del build.log
if exist error.log del error.log

rem ******************************************************************************
rem SET HMGPATH
rem -----------
rem
rem Using %~dp0 the HMGPATH is automatically set to current (hmg) folder making it
rem portable (zero config)
rem
rem ******************************************************************************

SET HMGPATH=%~dp0

rem ******************************************************************************
rem SET BINARIES PATHS
rem ******************************************************************************

SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%

rem *******************************************************************************


rem ******************************************************************************
rem COMPILE RESOURCES
rem ******************************************************************************

echo #define HMGRPATH %HmgPath%\RESOURCES > _hmg_resconfig.h
COPY /b %HMGPATH%\resources\hmg.rc+%~n1.rc+%HMGPATH%\resources\filler _temp.rc >NUL
windres -i _temp.rc -o _temp.o >hbmk.log 2>&1

rem *******************************************************************************


rem *******************************************************************************
rem SET PROJECT OUTPUT FILE NAME 
rem ----------------------------
rem
rem The first parameter sent to hbmk2 is -o%~n1.exe. I've added to it create the 
rem application with the project basename (<projectname.hbp> specified by the user.
rem
rem *******************************************************************************


rem *******************************************************************************
rem SET DEFAULT CONFIGURATION FILE
rem ------------------------------
rem
rem The second parameter sent to hbmk2 is the hmg.hbc script to set config required.
rem
rem *******************************************************************************


rem *******************************************************************************
rem SET GUI APPLICATION AS DEFAULT
rem ------------------------------
rem 
rem The third parameter sent to hbmk1 is -gtgui to build a GUI app. by default
rem
rem *******************************************************************************


rem *******************************************************************************
rem LINK COMPILED RESOURCES
rem -----------------------
rem 
rem The fourth parameter sent to hbmk1 is '_temp.o' compiled resources to be linked
rem
rem *******************************************************************************


rem ******************************************************************************
rem CALL HBMK2
rem ******************************************************************************

HBMK2 -o%~n1.exe %HMGPATH%\hmg.hbc -gtgui _temp.o %1 %2 %3 %4 %5 %6 %7 %8 >hbmk.log 2>&1

rem *******************************************************************************


rem ******************************************************************************
rem CREATE LOGS
rem ******************************************************************************

if errorlevel 1 if exist windres.log copy /a windres.log+hbmk.log error.log >nul
if errorlevel 1 if not exist windres.log copy /a hbmk.log error.log >nul

if errorlevel 0 if exist windres.log copy /a windres.log+hbmk.log build.log >nul
if errorlevel 0 if not exist windres.log copy /a hbmk.log build.log >nul

rem ******************************************************************************
rem CLEANUP
rem ******************************************************************************

if exist windres.log del windres.log
if exist hbmk.log del hbmk.log
if exist _hmg_resconfig.h del _hmg_resconfig.h
if exist _temp.rc del _temp.rc
if exist _temp.o  del _temp.o

rem ******************************************************************************
rem SHOW LOG
rem ******************************************************************************

if exist error.log type error.log
if exist build.log type build.log
Note that redir utility is not needed anymore. You can delete safely from util folder.

Please, test it.

TIA.

Thanks to Viktor and Maurizio for their help.

[EDIT]:

Errata:

Please change the line:

Code: Select all

windres -i _temp.rc -o _temp.o >hbmk.log 2>&1
with:

Code: Select all

windres -i _temp.rc -o _temp.o >windres.log 2>&1
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: HMG 3.0.36 (Test)

Post by Rathinagiri »

That is Fantastic!

Only one thing. hmgsqlite, hmgmysql and hmgpgsql are just bridges created by me, which needn't be included by default because all the three have the same function names sql(), connect2db(), miscsql(). IMHO, it can be included by the users themselves if they want to use the bridge.

So, there is no change in IDE?
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Post Reply