pCode DLL Sample

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2064
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

pCode DLL Sample

Post by AUGE_OHR »

hi,

i try to run Code from this Sample
https://harbour.wiki/index.asp?page=Pub ... 8267913849

i have copy Code into DllCode.PRG

Code: Select all

/*** dllcode.prg ***/
DYNAMIC QOUT, PROCNAME 
// added to inform compiler and linker that
// references to above functions have to be
// resolved dynamically at runtime
proc MY_PROC()
? PROCNAME() + ": hello !!!"
return
init proc start
? "INIT PROC", PROCNAME()
return
exit proc end
? "EXIT PROC", PROCNAME()
return
and run

Code: Select all

 hbmk2 -shared -strip -hbdyn dllcode.prg -n -w -es2
but i get Error
R:/Temp/hbmk_vujesp.dir/dllcode.o:dllcode.c:(.text+0x14): undefined reference to `hb_vmExecute'
R:/Temp/hbmk_vujesp.dir/dllcode.o:dllcode.c:(.text+0x34): undefined reference to `hb_vmExecute'
R:/Temp/hbmk_vujesp.dir/dllcode.o:dllcode.c:(.text+0x54): undefined reference to `hb_vmExecute'
R:/Temp/hbmk_vujesp.dir/dllcode.o:dllcode.c:(.text.startup+0x2c): undefined reference to `hb_vmProcessSymbols'
so what do i miss :?:
did someone have a working Sample, need help
have fun
Jimmy
User avatar
gfilatov
Posts: 1068
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: pCode DLL Sample

Post by gfilatov »

AUGE_OHR wrote: Mon May 30, 2022 9:53 am hi,

i try to run Code from this Sample
https://harbour.wiki/index.asp?page=Pub ... 8267913849
...
did someone have a working Sample, need help
Hi Jimmy,

Please take a look for a working sample along with all needed binaries in the attached archive. :arrow:
Attachments
pcodedll.zip
(2.41 MiB) Downloaded 110 times
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
AUGE_OHR
Posts: 2064
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: pCode DLL Sample

Post by AUGE_OHR »

hi Georgy,

Thx for Sample, it work great !

Question : what is libharbour-32.a for, it is not need in Sample

---

is a possible to create a harbour DLL for "other" App e.g. Xbase++ :idea:
have fun
Jimmy
User avatar
AUGE_OHR
Posts: 2064
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: pCode DLL Sample

Post by AUGE_OHR »

hi,

in harbour Group Eric Lendvai point me to this Article
https://harbour.wiki/index.asp?page=Pub ... 2413934099

i have build Sample COM DLL and can now use it under Xbase++ (or any other) as ActiveX :)
! Note : Need CLASS Code Syntax

! Tip :
*.HBP File have HB_PATH which must SET to c:\hmg.3.4.4\HARBOUR
to "register" DLL, using BuildCOM.BAT , you must run "as Administrator"
have fun
Jimmy
gisjr134
Posts: 44
Joined: Tue Dec 08, 2020 11:37 am
DBs Used: DBF,MySQL,PostgreSQL
Location: Brasil
Contact:

Re: pCode DLL Sample

Post by gisjr134 »

AUGE_OHR wrote: Mon May 30, 2022 1:02 pm hi Georgy,

Thx for Sample, it work great !

Question : what is libharbour-32.a for, it is not need in Sample

---

is a possible to create a harbour DLL for "other" App e.g. Xbase++ :idea:
Hi Everyone ,
With the utility QPM you may do it . There is a option 'Create Dll interface Library' , Where you will create one Dll originated from other DLL made it in Harbour\Mingw.
Post Reply