Page 1 of 1

HB_FUNC : BCC <-> MiniGW Different Syntax ?

Posted: Thu Aug 20, 2020 5:09 am
by AUGE_OHR
hi,

i try to run c:\MiniGUI\SAMPLES\Advanced\SysInfoTray\SysInfoTray.prg with HMG
my Problem are Error in HB_FUNC ... :o
WINDRES: _temp.rc:137: syntax error
Harbour 3.2.0dev (r1703241902)
Copyright (c) 1999-2016, http://harbour-project.org/
SysInfoTray.prg: In function 'HB_FUN_GETCPUUSAGE':
SysInfoTray.prg:436:29: warning: missing braces around initializer [-Wmissing-braces]
SysInfoTray.prg:436:29: note: (near initialization for 'oldValue')
SysInfoTray.prg:436:4: warning: missing initializer for field 'Timer' of '_VALUE {aka struct <anonymous>}' [-Wmissing-field-initializers]
SysInfoTray.prg:364:18: note: 'Timer' declared here
SysInfoTray.prg:437:29: warning: missing braces around initializer [-Wmissing-braces]
SysInfoTray.prg:437:29: note: (near initialization for 'newValue')
SysInfoTray.prg:437:4: warning: missing initializer for field 'Timer' of '_VALUE {aka struct <anonymous>}' [-Wmissing-field-initializers]
SysInfoTray.prg:364:18: note: 'Timer' declared here
SysInfoTray.prg: In function 'GetCPUCounterValue':
SysInfoTray.prg:426:43: warning: 'pCounterBlock' may be used uninitialized in this function [-Wmaybe-uninitialized]
gcc.exe: error: c:/hmg.3.4.4/0/SysInfoTray/_temp.o: No such file or directory
hbmk2[SysInfoTray]: Error: Running linker. 1
how to fix it for HMG / MiniGW :idea:

Re: HB_FUNC : BCC <-> MiniGW Different Syntax ?

Posted: Thu Aug 20, 2020 9:09 am
by gfilatov
AUGE_OHR wrote: Thu Aug 20, 2020 5:09 am i try to run c:\MiniGUI\SAMPLES\Advanced\SysInfoTray\SysInfoTray.prg with HMG
my Problem are Error in HB_FUNC ... :o

how to fix it for HMG / MiniGW :idea:
Hi Jummy,

Thanks for your interest to my humble contribution ;)

There is not an Error in HB_FUNC but it's the warnings only.

The problem is a difference in the resources definition between BCC and MinGW compilers.

You should fix the file SysInfoTray.rc as follow:
#define ICON_1 1001
#define ICON_2 1002
#define ICON_3 1003
#define ICON_4 1004
#define ICON_5 1005
#define ICON_6 1006
#define ICON_7 1007
#define ICON_8 1008
#define ICON_9 1009
#define ICON_10 1010
#define ICON_11 1011
#define ICON_12 1012

MAIN ICON main.ico

ICON_1 ICON ico\Icon_1.ico
ICON_2 ICON ico\Icon_2.ico
ICON_3 ICON ico\Icon_3.ico
ICON_4 ICON ico\Icon_4.ico
ICON_5 ICON ico\Icon_5.ico
ICON_6 ICON ico\Icon_6.ico
ICON_7 ICON ico\Icon_7.ico
ICON_8 ICON ico\Icon_8.ico
ICON_9 ICON ico\Icon_9.ico
ICON_10 ICON ico\Icon_10.ico
ICON_11 ICON ico\Icon_11.ico
ICON_12 ICON ico\Icon_12.ico

INFO BITMAP menu\info.bmp
EXIT BITMAP menu\exit.bmp
CHECK BITMAP menu\check.bmp

#define __VERSION_INFO

1 VERSIONINFO
FILEVERSION 1,0,1,0
PRODUCTVERSION 1,0,0,0
FILEOS 0x4
FILETYPE 0x1
{
BLOCK "StringFileInfo"
{
BLOCK "040904b0"
{
VALUE "FileDescription", "SysInfo Tray\000"
VALUE "FileVersion", "1.0.1.0"
VALUE "InternalName", "SysInfoTray\000"
VALUE "LegalCopyright", "Freeware 2007-2011\000"
VALUE "LegalTrademarks", "Harbour"
VALUE "OriginalFilename", "SysInfoTray.exe\000"
VALUE "CompanyName", ""
VALUE "ProductName", "MiniGUI Utility"
VALUE "ProductVersion", "1.0.0.0"
VALUE "Comments", "Created by Grigory Filatov <gfilatov@inbox.ru>\000"
}
}

BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409, 0x04B0
}
}
You will found the compiled application (along with updated RC file) in the attachment :arrow:

Re: HB_FUNC : BCC <-> MiniGW Different Syntax ?

Posted: Thu Aug 20, 2020 3:47 pm
by AUGE_OHR
hi,
gfilatov wrote: Thu Aug 20, 2020 9:09 am There is not an Error in HB_FUNC but it's the warnings only.
Ok Warning, not Error but how to avoid it :idea:
gfilatov wrote: Thu Aug 20, 2020 9:09 am The problem is a difference in the resources definition between BCC and MinGW compilers.
You should fix the file SysInfoTray.rc as follow:
this i have fix before :D

just make it clear : when switch from HMG-MiniGW to Extended Version-BCC all my HB_FUNC will work :?: