How to compile a HMG apps using Harbour hbmk2 ?

Source code related resources

Moderator: Rathinagiri

CCH4CLIPPER
Posts: 140
Joined: Tue Mar 03, 2009 8:59 am

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by CCH4CLIPPER »

Hi Luigi

From your earlier reply, I switched back to HB20 from HB21 and this frs4hmg.hbp built FRS4HMG.EXE perfectly

frs4hmg.hbp
=========
-oFRS4HMG.exe
-prgflag= -es2 -gtgui
-cflag=-O3

frs4hmg.hbc

-lhmg -lhbmzip -lhbwin -lhbct -lhbmisc -lxhb -lvfw32 -lmsvfw32

frs4w764.prg
locks.prg

Hip... Hip... Hooray !

CCH
http://cch4clipper.blogspot.com
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by l3whmg »

Hi CCH,
Hmmm! I think you are trying to compile with new version of Harbuor. It 's true as I suspect?
If this is true it's impossible: you can compile your programs only with the same version (Harbour and MinGw) distributed with HMG! I and others have already asked to update HMG3 to the new version. You can ask the same to Roberto and/or Rathinagiri in other post.

Can you tell me if you are using new Harbour?

Cheers
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by l3whmg »

Hi CCH,
I read the message of your success after having responded to the previous.
I'm glad you solved the problems. If you need anything else please feel free to ask.

Cheers
Luigi from Italy
www.L3W.it
CCH4CLIPPER
Posts: 140
Joined: Tue Mar 03, 2009 8:59 am

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by CCH4CLIPPER »

Hi Luigi

Thanx for your help thus far and the result is documented at http://cch4clipper.blogspot.com/2011/02 ... hbmk2.html

I have also posted a request to Roberto to update HMG.3.0.35 to Harbour 2.1. In the meantime, I have also written to Harbour's Viktor for any assistance :-)

Cheers

CCH
http://cch4clipper.blogspot.com
CCH4CLIPPER
Posts: 140
Joined: Tue Mar 03, 2009 8:59 am

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by CCH4CLIPPER »

Hi Luigi

Viktor's advice include :-

" In the example you use:
-lhbmzip -lhbwin -lhbct -lhbmisc -lxhb
So minizip lib is missing.

To ultimately fix it you instead should use:
hbmzip.hbc hbwin.hbc hbct.hbc hbmisc.hbc xhb.hbc

This will pull all necessary sublibs to the build."

Cheers

CCH
http://cch4clipper.blogspot.com
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by l3whmg »

Hi CCH,
many thanks for suggestion. I've tried but there are the same problem like your post here viewtopic.php?f=14&t=1879

A) When I create HMG library I receive a lot of warnings but only from (many) .c sources; none from .prg sources
B) When I try to create an executable (with this hmg library) this is the log

Code: Select all

Harbour 2.1.0rc1 (Rev. 16313)
Copyright (c) 1999-2011, http://harbour-project.org/
Compiling 'gacqp000.prg'...
.
.
Lines 12268, Functions/Procedures 6
Generating C source output to 'C:\DOCUME~1\luigi\IMPOST~1\Temp\hbmk_nm1uhq.dir\gacqp000.c'... Done.
D:/HMG4/Harbour/lib/win/mingw/libhbwin.a(legacycd.o):legacycd.c:(.text+0x0): multiple definition of `HB_FUN_GETLASTERROR'
D:/HMG4/ProvaHmg/lib/libhmg.a(c_winapimisc.o):c_winapimisc.c:(.text+0x1130): first defined here
collect2: ld returned 1 exit status
hbmk2: Error: Running linker
That is the same like you.

Anyway, thanks a lot...

Cheers
Luigi from Italy
www.L3W.it
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by l3whmg »

Hi CCH,
I've noticed some difference in log files...anyway.
First: I have commented some lines in Hmg3/source/c_winapimisc.c (L3W it's my signature)

Code: Select all

/* L3W HB_FUNC (GETLASTERROR )
{
  hb_retnl( (LONG) GetLastError() ) ;
} */
Second: I create Hmg library (same warnings...)
Third: :o :o I create my .exe ...but don't work :cry: This is hb_out.log

Code: Select all

Application Internal Error - D:\HMG4\ProvaHmg\gacqp000.exe
Terminated at: 2011.02.16 15:38:11
Unrecoverable error 6005: Exception error: 

    Exception Code:C0000005
    Exception Address:00000000
    EAX:00000001  EBX:00000000  ECX:0022F228  EDX:00B93C18
    ESI:00000000  EDI:00000000  EBP:00000000
    CS:EIP:001B:00000000  SS:ESP:0023:0022F39C
    DS:0023  ES:0023  FS:003B  GS:0000
    Flags:00010216
    CS:EIP:
    SS:ESP: 0040CEAF 00549451 0054945F 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0043F8C7 005980B0 00586921 00000000

    C stack:
    EIP:     EBP:       Frame: OldEBP, RetAddr, Params...

Modules:
0x00400000 0x001AD000 D:\HMG4\ProvaHmg\gacqp000.exe
0x7C910000 0x000B8000 C:\WINDOWS\system32\ntdll.dll
0x7C800000 0x00101000 C:\WINDOWS\system32\kernel32.dll
0x64D00000 0x00031000 C:\Programmi\Alwil Software\Avast5\snxhk.dll
0x77F40000 0x000AB000 C:\WINDOWS\system32\ADVAPI32.DLL
0x77DA0000 0x00093000 C:\WINDOWS\system32\RPCRT4.dll
0x77F10000 0x00011000 C:\WINDOWS\system32\Secur32.dll
0x5D4D0000 0x0009A000 C:\WINDOWS\system32\COMCTL32.DLL
0x77E40000 0x00049000 C:\WINDOWS\system32\GDI32.dll
0x7E390000 0x00091000 C:\WINDOWS\system32\USER32.dll
0x76360000 0x0004A000 C:\WINDOWS\system32\COMDLG32.DLL
0x7C9D0000 0x0081E000 C:\WINDOWS\system32\SHELL32.dll
0x77BE0000 0x00058000 C:\WINDOWS\system32\msvcrt.dll
0x77E90000 0x00076000 C:\WINDOWS\system32\SHLWAPI.dll
0x774B0000 0x0013E000 C:\WINDOWS\system32\OLE32.dll
0x770F0000 0x0008B000 C:\WINDOWS\system32\OLEAUT32.DLL
0x75DF0000 0x00021000 C:\WINDOWS\system32\MSVFW32.DLL
0x76B00000 0x0002E000 C:\WINDOWS\system32\WINMM.dll
0x72F70000 0x00026000 C:\WINDOWS\system32\WINSPOOL.DRV
0x76340000 0x0001D000 C:\WINDOWS\system32\IMM32.DLL
0x62E40000 0x00009000 C:\WINDOWS\system32\LPK.DLL
0x74D20000 0x0006B000 C:\WINDOWS\system32\USP10.dll
0x773A0000 0x00103000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll
0x5B180000 0x00038000 C:\WINDOWS\system32\uxtheme.dll
0x746B0000 0x0004C000 C:\WINDOWS\system32\MSCTF.dll
0x752E0000 0x0002E000 C:\WINDOWS\system32\msctfime.ime

Called from HB_DYNACALL1(0)
Called from CALLDLL32(7929) in source\h_controlmisc.prg
Called from ISAPPTHEMED(5588) in source\h_windows.prg
Called from _DEFINELABEL(102) in source\h_label.prg
Called from INITWAITWINDOW(5829) in source\h_windows.prg
Called from _ACTIVATEWINDOW(4764) in source\h_windows.prg
Called from DOMETHOD(7366) in source\h_controlmisc.prg
Called from P000_SHOWFORM(67) in gacqp000.prg
Called from P000_MAIN(22) in gacqp000.prg
Called from MAIN(9) in gacqp000.prg
------------------------------------------------------------------------
Luigi from Italy
www.L3W.it
CCH4CLIPPER
Posts: 140
Joined: Tue Mar 03, 2009 8:59 am

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by CCH4CLIPPER »

Hi Luigi

Latest Response from Viktor
=====================
You need to resolve missing externals (and double externals),
this is normal business and not related to hbmk2.

F.e. for this MCIwathever you need to add msvfw32 or vfw32 lib.

You need to ask HMG developers about these requirements,
and symbol clashes, I cannot give you specific answer, only
generic.

HTH

CCH
http://cch4clipper.blogspot.com
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by l3whmg »

Hi CCH,
Viktor is right.
I found interesting Roberto's comment about the creation of HMiniGui and the version of Harbour included (comment added on the site http://cch4clipper.blogspot.com but unfortunately I can not find the right link).
This comment confirms, theoretically, the need (today) to revise the code in according to the new version of the Harbour.

This is my opinion based on what I think I understand :mrgreen:

About these library: this was difference from me and you that I have notice in the log file.
Infact, I've added this two libraries when I create my executable program. But I don't know if they are mandatory for Hmg library creation :?:

I'm sorry: I'm not really qualified to express other opinions :oops:

Cheers
Luigi from Italy
www.L3W.it
CCH4CLIPPER
Posts: 140
Joined: Tue Mar 03, 2009 8:59 am

Re: How to compile a HMG apps using Harbour hbmk2 ?

Post by CCH4CLIPPER »

Hi Luigi

The final conclusion is that HMG.3.0.35 cannot be compiled with Harbour 2.1 :-(

CCH
http://cch4clipper.blogspot.com
Post Reply