Need some help compiling Przemek's example from june 2007

harbour nightly build
slackware linux

2 prg's, tst.prg and dllcode.prg

# hbmk2 -static tst.prg       --> creates tst
# hbmk2 -hbdyn dllcode.prg    --> creates dllcode.so


#./tst
Begin:          1
Cannot load DLL library: dllcode.so
./dllcode.so: undefined symbol: hb_vmExecute


What am i missing?

Regards
Emmer

ps. i removed the windows stuff from the examples


/*** tst.prg ***/
proc main()
local h, cExt, xRetVal,n

cExt:=".so"
for n := 1 to 2
  ? "Begin:", n
  h := HB_LIBLOAD("./dllcode"+cExt)
  if EMPTY(h)
     ? "Cannot load DLL library: dllcode"+cExt
     ? HB_LIBERROR()
     quit
  endif
  xRetVal:=HB_LIBDO("DLLFUNC")
  ? iif(valtype(xRetVal)=="B", eval(xRetVal), xRetVal)
  xRetVal:=HB_LIBDO("DLLFUNC")
  ? iif(valtype(xRetVal)=="B", eval(xRetVal), xRetVal)
  HB_LIBFREE(h)
  ? "DLL library unloaded"
  ? iif(valtype(xRetVal)=="B", eval(xRetVal), xRetVal)
  ? iif(valtype(xRetVal)=="B", eval(xRetVal,"result: "), xRetVal)
next
return




/*** dllcode.prg ***/
DYNAMIC QOUT, UPPER

static s_var := "I'm static variable"

func DLLFUNC
local xRet:="DLLFUNC RETURN VALUE"
? "I'm DLL function"
? s_var
s_var := UPPER( s_var )
? s_var
return {|x|iif(x==nil,xRet,x+xRet)}

init proc DLLINIT
? "I'm DLL INIT procedure"
return

exit proc DLLEXIT
? "I'm DLL EXIT procedure"
return


_______________________________________________
Harbour-users mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour-users

Reply via email to