Page 3 of 4

Re: Editsource() Problem

PostPosted: Tue Jun 09, 2020 1:11 pm
by ricbarraes
Antonio Linares wrote:Please try to remove hbwin and -mt from the hbp file and let us know what you get


unfortunately we can't remove -mt because our application is multithread. when we tried to build it without this parameter i guess the thread pool just stopped working.

Thanks for all your effort, guys. we really appreciate it.

Meanwhile, we'll get back to make.exe as it is working fine.

Re: HBMK2 Problem linking

PostPosted: Tue Jun 09, 2020 1:19 pm
by ricbarraes
Just for the record...

we are working with a .hbp to compile and link the exe, and another .hbp file to compile and generate our .hrb files.

and everything seems ok with our .hrb files, no issue found yet.

I'll leave an example of our .hbp file here, so you can take a look if you want to:

Code: Select all  Expand view

#Gerar HRB
-gh

-inc

-ic:\FWH19\include

C:\TEC2000\SGV90\EXT\GCD\*.PRG
C:\TEC2000\SGV90\EXT\SAL\*.PRG
C:\TEC2000\SGV90\EXT\CPR\*.PRG
C:\TEC2000\SGV90\EXT\FRT\*.PRG
C:\TEC2000\SGV90\EXT\PCP\*.PRG
C:\TEC2000\SGV90\EXT\SAC\*.PRG
C:\TEC2000\SGV90\EXT\SAL\*.PRG
C:\TEC2000\SGV90\EXT\SCA\*.PRG
C:\TEC2000\SGV90\EXT\SGR\*.PRG
C:\TEC2000\SGV90\EXT\SIF\*.PRG
C:\TEC2000\SGV90\EXT\STV\*.PRG

-workdir=C:\TEC2000\SGV90\HRB\

Re: HBMK2 Problem linking

PostPosted: Tue Jun 09, 2020 9:47 pm
by Antonio Linares

Re: Editsource() Problem

PostPosted: Tue Jun 09, 2020 10:36 pm
by cnavarro
vilian wrote:Mr Rao,
I'm using HBMK2 to generate the EXE. IF you save the hbp file bellow as test.hbp in your sample directory, and do HBMK2 test.hbp, you will see the problem.
Code: Select all  Expand view

#Nome do arquivo gerado
-otestsqla

#Tipo de arquivo gerado (exe)
-hbexe
-mt

#Incremental
-inc

#Includes
-ic:\FWH19\include

#Lib's
-Lc:\FWH19\lib
-lFiveH
-lFiveHC
-lLibMySql

-lhbwin
-lgtgui
-lhbct
-lhbpp
-lxhb
-lhbziparc
-lhbmzip
-lminizip
-lhbtip

-Lc:\Bcc73\lib
-lcw32mt
-luuid
-limport32
-lws2_32

-Lc:\Bcc73\lib\psdk
-lodbc32
-lnddeapi
-liphlpapi
-lmsimg32
-lpsapi
-lrasapi32
-lgdiplus
-lshell32


#PRGs
C:\FWH19\SAMPLES\TESTSQLA.PRG

#Identifica que usa UI
-gtgui

1.- The main problem is that the prg should appear at the beginning of the .hbp file
2.- In windows console
set path=%PATH%;c:\borland\bcc7\bin;C:\harbour\bin;


3.- Your testsqla.hbp
Code: Select all  Expand view

#PRGs
#at the beginning of the hbp file put your prgs
C:\FWH19\SAMPLES\TESTSQLA.PRG

#Nome do arquivo gerado
-oc:\fwh19\samples\testsqla

-n
-m
-es1
-gc1
-w1
-mt
-info
-trace

#Incremental
#-inc

-cflag=-c -O2
-gui

#Includes
-ic:\FWH19\include

#Lib's
-Lc:\FWH19\lib
-lFiveH
-lFiveHC
-lLibMySql

-lhbwin
-lgtgui
-lhbct
-lxhb
-lhbmisc
-lhbziparc
-lhbmzip
-lminizip
-lhbtip


4.- in windows console
hbmk2 testsqla.hbp -comp=bcc ( -comp=bcc this not neccesary if you not have other path of compiler defined in your path )
hbmk2 testsqla.hbp


Try and tell me

Re: Editsource() Problem

PostPosted: Wed Jun 10, 2020 2:10 am
by ricbarraes
it seems to be working now!! we already tried both examples that Mr Rao posted previously and now they are returning the exact same result!

Tomorrow morning we'll try it in our application, and hopefully it's going to be ok.

Thank so much!!

You said that the main problem is related to the position of our prg files, ok, we got it...
But we noticed that you added some parameters to the hbp, would you mind to explain them to us?

1- like, why did you added -es1? I don't really know what "exit severity" means and what's the effect over the process...

2- is there any difference between -gui and -gtgui ?

3- what does the parameter '-m' do, exactly?

Sorry for all the questions, and thank you again for all the effort you guys put on it!

cnavarro wrote:
vilian wrote:Mr Rao,
I'm using HBMK2 to generate the EXE. IF you save the hbp file bellow as test.hbp in your sample directory, and do HBMK2 test.hbp, you will see the problem.
Code: Select all  Expand view

#Nome do arquivo gerado
-otestsqla

#Tipo de arquivo gerado (exe)
-hbexe
-mt

#Incremental
-inc

#Includes
-ic:\FWH19\include

#Lib's
-Lc:\FWH19\lib
-lFiveH
-lFiveHC
-lLibMySql

-lhbwin
-lgtgui
-lhbct
-lhbpp
-lxhb
-lhbziparc
-lhbmzip
-lminizip
-lhbtip

-Lc:\Bcc73\lib
-lcw32mt
-luuid
-limport32
-lws2_32

-Lc:\Bcc73\lib\psdk
-lodbc32
-lnddeapi
-liphlpapi
-lmsimg32
-lpsapi
-lrasapi32
-lgdiplus
-lshell32


#PRGs
C:\FWH19\SAMPLES\TESTSQLA.PRG

#Identifica que usa UI
-gtgui

1.- The main problem is that the prg should appear at the beginning of the .hbp file
2.- In windows console
set path=%PATH%;c:\borland\bcc7\bin;C:\harbour\bin;


3.- Your testsqla.hbp
Code: Select all  Expand view

#PRGs
#at the beginning of the hbp file put your prgs
C:\FWH19\SAMPLES\TESTSQLA.PRG

#Nome do arquivo gerado
-oc:\fwh19\samples\testsqla

-n
-m
-es1
-gc1
-w1
-mt
-info
-trace

#Incremental
#-inc

-cflag=-c -O2
-gui

#Includes
-ic:\FWH19\include

#Lib's
-Lc:\FWH19\lib
-lFiveH
-lFiveHC
-lLibMySql

-lhbwin
-lgtgui
-lhbct
-lxhb
-lhbmisc
-lhbziparc
-lhbmzip
-lminizip
-lhbtip


4.- in windows console
hbmk2 testsqla.hbp -comp=bcc ( -comp=bcc this not neccesary if you not have other path of compiler defined in your path )
hbmk2 testsqla.hbp


Try and tell me

Re: HBMK2 Problem linking

PostPosted: Wed Jun 10, 2020 6:44 am
by nageswaragunupudi
Mr. Ricardo

Can you please post your full hbp script here?

Re: Editsource() Problem

PostPosted: Wed Jun 10, 2020 8:04 am
by Enrico Maria Giordano
ricbarraes wrote:1- like, why did you added -es1? I don't really know what "exit severity" means and what's the effect over the process...

2- is there any difference between -gui and -gtgui ?

3- what does the parameter '-m' do, exactly?


1. I recommend -es2 that force you to correct errors and warnings before even generate any result.

2. I don't know, sorry. I didn't find them among the compiler switches and options.

3. It compiles only the current PRG (ie. doesn't compile DO referenced modules).

EMG

Re: HBMK2 Problem linking

PostPosted: Wed Jun 10, 2020 8:38 am
by cnavarro
Ricardo,
-gui|-std create GUI/console executable


For all information about hbmk2, please, go to your \harbour\bin ( command console ), and write

hbmk2 -help > hbmk2.txt

and search in this hbmk2.txt document your doubts
Also, execute
harbour > harbour.txt

More information about options compiler
https://harbour.github.io/doc/harbour.h ... er-options
Read this document harbour.txt

Re: Editsource() Problem

PostPosted: Wed Jun 10, 2020 6:07 pm
by ricbarraes
Thank you Enrico! now it all makes sense!


Enrico Maria Giordano wrote:
ricbarraes wrote:1- like, why did you added -es1? I don't really know what "exit severity" means and what's the effect over the process...

2- is there any difference between -gui and -gtgui ?

3- what does the parameter '-m' do, exactly?


1. I recommend -es2 that force you to correct errors and warnings before even generate any result.

2. I don't know, sorry. I didn't find them among the compiler switches and options.

3. It compiles only the current PRG (ie. doesn't compile DO referenced modules).

EMG

Re: HBMK2 Problem linking

PostPosted: Wed Jun 10, 2020 6:12 pm
by ricbarraes
Ok, thank you Mr. Navarro! I'll take a look at this document for sure!
nageswaragunupudi wrote:Mr. Ricardo

Can you please post your full hbp script here?


cnavarro wrote:Ricardo,
-gui|-std create GUI/console executable


For all information about hbmk2, please, go to your \harbour\bin ( command console ), and write

hbmk2 -help > hbmk2.txt

and search in this hbmk2.txt document your doubts
Also, execute
harbour > harbour.txt

More information about options compiler
https://harbour.github.io/doc/harbour.h ... er-options
Read this document harbour.txt


Sure, of course Mr. Rao. Give me a few minutes and I'll post it right here

nageswaragunupudi wrote:Mr. Ricardo

Can you please post your full hbp script here?

Re: HBMK2 Problem linking

PostPosted: Wed Jun 10, 2020 11:26 pm
by ricbarraes
Ok, guy, here it is...

both hbp files, the first one is generating our HRB files and the second one is generating our EXE

FAZHRB.HBP
Code: Select all  Expand view

C:\TEC2000\SGV90\EXT\GCD\*.PRG
C:\TEC2000\SGV90\EXT\SAL\*.PRG

-gh

-inc

-workdir=C:\TEC2000\SGV90\HRB\

-ic:\FWH19\include




FAZEXE.HBP
Code: Select all  Expand view


FAZHRB.HBP

C:\TEC2000\SGV90\PRG\SGV.PRG  
C:\TEC2000\SGV90\PRG\SIF130.PRG  
C:\TEC2000\SGV90\PRG\SIF160.PRG
C:\TEC2000\SGV90\RES\SGV.RES

-osgv
-hbexe
-n
-m
-es2
-gc1
-mt
-gtgui
-workdir=C:\TEC2000\SGV90\build\
-inc

-ic:\FWH19\include

-Lc:\FWH19\lib
-lvfawin40
-lTwBrw32h                                            
-lBarLib32                                            
-lFileXls                                            
-lLibMySql
-lFiveH
-lFiveHC

-lhbwin
-lgtgui
-lhbct
-lxhb
-lhbziparc
-lhbmzip
-lminizip
-lhbtip

-Lc:\Bcc73\lib
-lcw32mt
-luuid
-limport32
-lws2_32

-Lc:\Bcc73\lib\psdk
-lodbc32
-lnddeapi
-liphlpapi
-lmsimg32
-lpsapi
-lrasapi32
-lgdiplus
-lshell32


Thank you again for the support!

Re: HBMK2 Problem linking

PostPosted: Sun Jun 14, 2020 8:47 pm
by ricbarraes
Hey guys,

apparently there are still some issues about the hbmk2 linking...

We are running a query like that in our application:

Code: Select all  Expand view
SELECT mat.fields, mix.fields FROM material AS mat LEFT JOIN matmix AS mix ON mat.cmat=mix.cmat AND '01' = mix.calmox WHERE mat.data_inc >= '2020-06-14' AND mix.calmox = '01' AND mix.situacao <> 'I' ORDER BY mat.data_inc DESC LIMIT 1000


And we are displaying the variable cResyncSQL like that (right after running the query above):

Code: Select all  Expand view
? oQryBrw:cResyncSQL


Using the hbmk2 to compile and link our appication, we are having this as a return:

Code: Select all  Expand view
SELECT mat.fields, mix.fields FROM material AS mat LEFT JOIN matmix AS mix ON mat.cmat=mix.cmat AND '01' = mix.calmox WHERE <<?>> AND (mat.data_inc >= '2020-06-14' AND mix.calmox = '01' AND mix.situacao <> 'I' ORDER BY mat.data_inc DESC LIMIT 1000)


As you can see, the query structure is wrong.

We started to track this issue, checking on our code and everything, made some changes and nothing happened.

Then we decided to change the linking process to the way we used to do (via ilink) like that:

Code: Select all  Expand view
set oldpath=C:\TEC2000\SGV90
set path=c:\BCC73\bin;C:\TEC2000\SGV90
c:\harbour19\bin\hbmk2 FAZEXE.hbp
set path=%oldpath%
del sgv.exe
c:\bcc73\bin\ilink32 -Gn -aa -Tpe -s @b32.bc
set path=%oldpath%
vfatec.exe


and everything started to work well again...

this is the return we got after this change:

Code: Select all  Expand view
SELECT mat.fields, mix.fields FROM material AS mat LEFT JOIN matmix AS mix ON mat.cmat=mix.cmat AND '01' = mix.calmox WHERE <<?>> AND (mat.data_inc >= '2020-06-14' AND mix.calmox = '01' AND mix.situacao <> 'I') ORDER BY mat.data_inc DESC LIMIT 1000


ps: we didn't change anything on the .HBP file that we shared above.

Does anybody knows what could be wrong this time?

Re: HBMK2 Problem linking

PostPosted: Mon Jun 15, 2020 4:09 am
by Antonio Linares
Ricardo,

Please use these flags from your hbp files:

-trace
-info

so you can see what libraries are getting linked and in which order and compare them when using ilink

Re: Editsource() Problem

PostPosted: Mon Jun 15, 2020 1:44 pm
by ricbarraes
Hey Antonio, thanks for your reply

I already did that earlier in this discussion, I noticed that the order is pretty different and we can't really change that.
all the Harbour core lib's, by default, are being linked after all the other lib's (fwh lib's and bcc lib's) and there's nothing we can do, because when we try to add these harbour core lib's in order, hbmk2 ignores it.

ricbarraes wrote:Hello, I'm working with Vilian in this project

Using builh.bat is possible to create a script and set the order for our files to be compiled. But hbmk2, eventhough we define an order in our .hbp file, the sequence is completely different because, by default, the core harbour libraries are compiled/linked after all of the files listed in our .hbp file.

I was able to track this difference by comparing the .map file generated by both building processes and by tracing it in .hbp files.

We suspect that this difference between building processes are changing the priority of our overwritten methods. I don't really know if that makes senses, but as we are clueless about this issue, maybe that could be a start point...



this is the right order when we are linking using ilink:

Code: Select all  Expand view

vfawin40.lib ,TwBrw32h.lib ,BarLib32.lib mFileXls.lib ,FiveH.lib ,FiveHC.lib,LibMySql.lib ,hbwin.lib ,gtgui.lib ,hbrtl.lib ,hbvmmt.lib ,hblang.lib ,
hbmacro.lib ,hbrdd.lib ,rddntx.lib ,rddcdx.lib ,rddfpt.lib ,hbsix.lib ,hbcommon.lib ,hbpp.lib ,hbcpage.lib ,hbcplr.lib ,hbct.lib ,hbpcre.lib ,
xhb.lib ,hbziparc.lib ,hbmzip.lib ,hbzlib.lib ,minizip.lib ,hbusrrdd.lib ,hbtip.lib ,cw32mt.lib ,uuid.lib ,import32.lib ,ws2_32.lib ,odbc32.lib ,
nddeapi.lib ,iphlpapi.lib ,msimg32.lib ,psapi.lib ,rasapi32.lib ,gdiplus.lib ,shell32.lib,



And this is the return we got tracking the hbmk2:

Code: Select all  Expand view
vfawin40.lib TwBrw32h.lib BarLib32.lib FileXls.lib FiveH.lib FiveHC.lib LibMySql.lib hbwin.lib gtgui.lib hbct.lib xhb.lib hbziparc.lib hbmzip.lib
minizip.lib hbtip.lib cw32mt.lib uuid.lib import32.lib ws2_32.lib odbc32.lib nddeapi.lib iphlpapi.lib msimg32.lib psapi.lib rasapi32.lib gdiplus.lib shell32.lib hbextern.lib hbdebug.lib hbvmmt.lib hbrtl.lib hblang.lib hbcpage.lib gtcgi.lib gtpca.lib gtstd.lib gtwin.lib gtwvt.lib gtgui.lib hbrdd.lib hbuddall.lib hbusrrdd.lib rddntx.lib rddcdx.lib rddnsx.lib rddfpt.lib hbrdd.lib hbhsx.lib hbsix.lib hbmacro.lib hbcplr.lib hbpp.lib hbcommon.lib winmm.lib kernel32.lib, user32.lib gdi32.lib advapi32.lib ws2_32.lib iphlpapi.lib winspool.lib comctl32.lib comdlg32.lib shell32.lib uuid.lib ole32.lib oleaut32.lib mpr.lib mapi32.lib imm32.lib msimg32.lib wininet.lib hbpcre.lib hbzlib.lib   cw32mt.lib import32.lib

Re: HBMK2 Problem linking

PostPosted: Mon Jun 15, 2020 2:05 pm
by nageswaragunupudi
Using builh.bat is possible to create a script and set the order for our files to be compiled.

Even if shuffle the order also the regex functions are linked correctly by buildh.bat

Please do not directly check for oRs:cResyncSQL.

Please check for the two small programs I posted in this thread before. These two programs are totally independent of FWH libs.