Page 1 of 1

HMG app called from within plugin

Posted: Sat Jul 03, 2010 2:58 am
by FrankE
Hi

Not sure if the following is possible ... actually, I think it probably is possible, I'm just hopeless at C/C++ and not sure how to go about it.

I wish to be able to include HMG app "C" code in writing plugins for a 3D application, where the plugin itself is compiled to ".dll" rather than ".exe". Why? ... because the whole xBase thing just works so well :-) ...

First steps I've taken are:
Attempt to compile the ".c" code created via HMG 3.0.34 (which is a great product by the way!). The app is a simplw window with one button.
- I'm using Bloodshed's Dev C++ with its own MinGW32.
- I've added every possible lib/include I could find to the Dev C++ IDE
- no success :-( ...

The strategy is to go one step at a time - I figure if I can get this happening first to .exe, I can then proceed to .dll with all the additional plugin specific details.

I would greatly value help in getting this first step to work.

Posted below is the result of the failed compile:

Apologies for the length of this post.

Regards,
Frank E.
Compiler: Default compiler
Building Makefile: "C:\Frank\Clipper_New\Test_Simple\.hbmk\win\mingw\Makefile.win"
Executing make...
make.exe -f "C:\Frank\Clipper_New\Test_Simple\.hbmk\win\mingw\Makefile.win" all
gcc.exe main.o _hbmkaut.o -o "Test-02.exe" -L"C:/Dev-Cpp/lib" -L"C:/hmg.3.0.34/MINGW/lib" -L"C:/hmg.3.0.34/HARBOUR/lib" -L"C:/hmg.3.0.34/LIB"

main.o(.text+0x2e):main.c: undefined reference to `hb_vmProcessSymbols'
main.o(.text+0x50):main.c: undefined reference to `hb_vmExecute'
main.o(.data+0x28):main.c: undefined reference to `HB_FUN__DEFINEWINDOW'
main.o(.data+0x48):main.c: undefined reference to `HB_FUN__DEFINEBUTTON'
main.o(.data+0x58):main.c: undefined reference to `HB_FUN__DEFINEIMAGEBUTTON'
main.o(.data+0x68):main.c: undefined reference to `HB_FUN__DEFINEMIXEDBUTTON'
main.o(.data+0x78):main.c: undefined reference to `HB_FUN__ENDWINDOW'
main.o(.data+0x88):main.c: undefined reference to `HB_FUN_DOMETHOD'
main.o(.data+0x98):main.c: undefined reference to `HB_FUN_ERRORSYS'
_hbmkaut.o(.text+0xb):_hbmkaut.c: undefined reference to `hb_vmSetDefaultGT'
_hbmkaut.o(.text+0x24):_hbmkaut.c: undefined reference to `HB_FUN_HB_GT_GUI'
_hbmkaut.o(.text+0x2c):_hbmkaut.c: undefined reference to `hb_forceLinkMainWin'
C:/Dev-Cpp/lib/libmingw32.a(main.o)(.text+0x106):main.c: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status

make.exe: *** [Test-02.exe] Error 1

Execution terminated

Re: HMG app called from within plugin

Posted: Sat Jul 03, 2010 5:02 am
by dhaine_adp
Hi Frank,

Looks likes the compiler did not find the HMG and Harbour Libraries. Well first, compare the version of MingW from Bloodshed and then version that comes with HMG. If the latest is from Bloodshed, compile some sample from hmg\samples if you can successfully compile those with the Bloodshed version and or vice versa.

Then pull-out the HMG code from your plug-in source code and compile it alone as an HMG app. If that is successfull then the problem lies somewhere on your makefile script. Basically, the compiler should find the libraries and include files from (assuming the location of HMG installation is) hmg\include, hmg\lib, hmg\harbour\include, and hmg\harbour\lib

I hope that this gives you some sort of clue. (Sorry that's all that I can deduced from your posted compiler error).

Regarding Bloodshed, I don't know if anybody here is using Bloodshed but on HMG side perhaps (I believed) we can provide an answer.

Regards,


Danny