hbmk2 problem

hbmk2 problem

Postby TimStone » Mon Jul 10, 2023 5:29 pm

Over the past couple of years, there has been encouragement to use Harbor's hbmk2 to build applications.

My application is large, and with Antonio's guidance, I have attempted to build it using hbmk2

PLEASE NOTE: The program builds without error using a .mak file, and also building with Visual Studio Community 2023 directly. So this is NOT a coding error.

I have done a series of eliminations, and extensive testing, and the following is the result:


Code: Select all  Expand view
oARhistory:seek( dBegDate, .t. )


oARhistory is a database object

The error returned is: marutilities.prg(106) Error E0030 Syntax error "syntax error at '('"

The failure is that hbmk2 does not recognize more than the first parameter in the Seek() method. It will compile correctly if I comment out the 2nd parameter. In the database class, seek is defined as:

Code: Select all  Expand view
  METHOD Seek( uExp, lSoft, lWildSeek, lCurRec )


In this case, I am passing a value of TRUE for lSoft ( soft seek ).

This would suggest that hbmk2 is actually not processing the database class in FWH but using something native to Harbour itself.

Has anyone else experienced this ? If so, have you found a workaround ? If you are using hbmk2 perhaps you have some further guidance. Thank you.

( I know it is very popular to ask for a working sample. However, I believe the issue here is very specific and enough detail has been provided. It would be a challenge to try and write a small subset of code )
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2943
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: hbmk2 problem

Postby Antonio Linares » Mon Jul 10, 2023 5:48 pm

Dear Tim,

I just coded this little PRG and hbmk2 properly builds it so I tend to think that there is a preprocessor issue. Please compile it using -p to generate a PPO file and please check if such line gets modified, maybe a define is changing the code, many thanks:

This code generates an obvious runtime error but not a compiling error. The compiler does not check classes, etc. It just check the syntax.

tim.prg
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

    local o, dToday := Date()

    o:seek( dToday, .T. )

return nil


tim.hbp
Code: Select all  Expand view
-gui

tim.prg

-Ic:\fwh\include

-Lc:\fwh\lib
-lfiveh32
-lfivehc32

-lgdiplus
-lole32
-lOleDlg
-lversion

xhb.hbc
hbmzip.hbc
hbziparc.hbc

-ldflag=/NODEFAULTLIB:msvcrt


and this go.bat to build it:
Code: Select all  Expand view
setlocal
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
c:\harbour\bin\win\msvc\hbmk2 tim.hbp
endlocal
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42063
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: hbmk2 problem

Postby TimStone » Mon Jul 10, 2023 6:39 pm

I am seeing this:

        oARhistory := TARhistory():New( 2 )

       oARhistory:(.T.)->( dbSeek( dBegDate ) )

        while ! oARhistory:eof( )
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2943
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: hbmk2 problem

Postby Antonio Linares » Mon Jul 10, 2023 9:13 pm

Dear Tim,

What header files .CH are you using from such PRG ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42063
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: hbmk2 problem

Postby TimStone » Mon Jul 10, 2023 9:35 pm

For that .prg, just fivewin.ch and tdata.ch. I commented out the the tdata, though that has no reference to seek(), and it made no difference. So essentially, just fivewin
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2943
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: hbmk2 problem

Postby Antonio Linares » Mon Jul 10, 2023 9:53 pm

Dear Tim,

It seems as

oARhistory:seek( dBegDate, .t. )

is preprocessed into:

oARhistory:(.T.)->( dbSeek( dBegDate ) )

Please search in all your used CH files and look for dbSeek
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42063
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: hbmk2 problem

Postby Antonio Linares » Mon Jul 10, 2023 9:56 pm

Also, please comment this line in fwstd.ch

// #command SEEK <xpr> => dbSeek( <xpr> )

just in case the error comes from here
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42063
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: hbmk2 problem

Postby TimStone » Mon Jul 10, 2023 10:14 pm

I made the change you suggested and have the same error.

I did a search of ALL .ch files in FWH, Harbour, and my program. I looked for instances of SEEK and DBSEEK
There were no re-defines in any of those

It is strange that clearly, as shown by the PPO, that :seek is being redefined, but just how seems to be avoiding us.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2943
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: hbmk2 problem

Postby Antonio Linares » Tue Jul 11, 2023 6:28 am

Dear Tim,

Please build my above example and lets see what you get

thank you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42063
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: hbmk2 problem

Postby TimStone » Wed Jul 12, 2023 7:24 pm

Antonio,

Yesterday was our 53rd wedding anniversary, so I took off most of the day.

I did the build this morning, and it comes up as it did with you.

I also defined o as a tdatabase():new( ) and it still shows, in the PPO, that the seek in correct.

So now I will need to continue searching for an include file that might redefine the seek.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2943
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: hbmk2 problem

Postby TimStone » Wed Jul 12, 2023 10:47 pm

Antonio,

In your example, the code:o:seek( dToday, .T. ) becomes:o:seek( dToday, .T. ) in the PPO

In my application, oARhistory:seek( dBegDate, .t. ). becomes: oARhistory:(.T.)->( dbSeek( dBegDate ) )

Clearly a #translate is active here. I have looked at:
+ All source code I have written
+ All FWH source in classes, functions, and winapi
+ All FWH\include files
+ All Harbour\include files
+ Any project include files

I can't find a seek( ) modification anywhere.

Do you have any other ideas on where to look ?

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2943
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: hbmk2 problem

Postby Antonio Linares » Thu Jul 13, 2023 4:40 am

Dear Tim,

Do you use any #define on that PRG ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42063
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: hbmk2 problem

Postby TimStone » Thu Jul 13, 2023 5:39 am

There are no #define in that .prg

There are some elsewhere in the total application, but none of them show anything related to databases.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2943
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: hbmk2 problem

Postby Antonio Linares » Thu Jul 13, 2023 8:44 am

Dear Tim,

Then I would suggest to completely remove all the files in FWH\include and reinstall them

If that does not solve it, then you should do the same with harbour\include folder
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42063
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: hbmk2 problem

Postby TimStone » Thu Jul 13, 2023 10:07 pm

The easiest way to do that is to install the latest downloads from the FW subscription site.

That was no problem for FWH. However, the latest posted MVSC Harbour build is 3 years old, and it does not show a download.

Do you have a link to download the latest Harbour installation file ? Maybe there is a problem with the older version.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2943
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests