Page 4 of 4

Re: HBMK2 Problem linking

PostPosted: Mon Jun 15, 2020 2:12 pm
by Antonio Linares
Ricardo,

If you use:

-ldflag=@libs.txt

then you can specify in libs.txt the libs and the order that you want

Re: HBMK2 Problem linking

PostPosted: Mon Jun 15, 2020 8:08 pm
by ricbarraes
Sorry to bother you, Antonio...

I found in the documentation an explanation about this tag, but it seems pretty vague to me:

ldflags= space separated list of values as in -ldflag= option
ldflags+= space separated list of values as in -ldflag+= option


I already tried many ways to populate this .txt file and I'm getting linking errors every single time,

do you have any example or any other documentation describing how to do it?


Antonio Linares wrote:Ricardo,

If you use:

-ldflag=@libs.txt

then you can specify in libs.txt the libs and the order that you want


Thanks for you reply, Mr. Rao.

Ok, I'll try it with this examples you posted

just a moment...

nageswaragunupudi wrote:
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.

Re: HBMK2 Problem linking

PostPosted: Mon Jun 15, 2020 9:31 pm
by ricbarraes
Mr. Rao,

I tried to run your samples (but with my new query, instead) and it returned an error. it's not the same problem, but the query is also returning with a wrong structure.

this is the sample I ran (I resumed the query a little bit):
Code: Select all  Expand view

#include "fivewin.ch"

function Main()

   local oCn, oRs
   local cSql, nAt := 0

   cSql  := "SELECT * FROM states AS st LEFT JOIN teste AS tes ON st.ctest=tes.ctest WHERE tes.data >= '2019-06-16' AND tes.calmox='01' AND tes.situacao <> 'I' ORDER BY tes.data DESC LIMIT 5"
   HB_AtX( " ORDER BY | HAVING | LIMIT | GROUP ", cSql, .f., @nAt )
   ? nAt, cSql, SubStr( cSql, nAt )

 
return nil



this is the .hbp file processed by hbmk2:
Code: Select all  Expand view

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

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

-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


And this is the return:

"SELECT * FROM states AS st LEFT JOIN teste AS tes ON st.ctest=tes.ctest WHERE tes.data >= '2019-06-16' AND tes.calmox='01' AND tes.situacao <> 'I' ORDER BY tes.data DESC LIMIT 5 ORDER BY tes.data DESC LIMIT 5"

Re: HBMK2 Problem linking

PostPosted: Tue Jun 16, 2020 12:36 am
by nageswaragunupudi
That means the correct function HB_AtX is not linked.
Instead of getting unresolved external, how a dummy function is linked returning 0 (zero) ?
surprising.

Re: HBMK2 Problem linking

PostPosted: Tue Jun 16, 2020 1:24 am
by ricbarraes
nageswaragunupudi wrote:That means the correct function HB_AtX is not linked.
Instead of getting unresolved external, how a dummy function is linked returning 0 (zero) ?
surprising.


yes, I found it very weird and I decided to try again. but this time I copied all my files to a new path, and ran again the sample...

and it worked! :lol:

Probably I was doing something wrong but now the sample is running fine!

it returned the same query:

"SELECT * FROM states AS st LEFT JOIN teste AS tes ON st.ctest=tes.ctest WHERE tes.data >= '2019-06-16' AND tes.calmox='01' AND tes.situacao <> 'I' ORDER BY tes.data DESC LIMIT 5"


but I'm still having trouble with my code that requires more lib's from fwh and harbour... :(

maybe the parameter that Antonio mentioned could be a solution, but I can't get the right way to populate the .txt file...