B
bbmerong
have a question about "ruby/dl".
I define the function in "ruby/dl" like the belows
--------------------------------------
require 'dl'
LIB=DL.dlopen('libfunc.dll')
cfunc=LIB['cfunc','ISi'] # int cfunc(char *data,int *num)
---------------------------------------
After typing in irb, I typed them like this.
len=DL.malloc(DL.sizeof("I"))
err=cfunc.call("hello",len)
But, error message is displayed like the belows.
"TypeError: can't convert DL:trData into Integer"
I'm not sure how to solve the problem.
Please let me know the reason and solutions for novice like me.
It make me crazy.
Then, Thank you in advance.
I define the function in "ruby/dl" like the belows
--------------------------------------
require 'dl'
LIB=DL.dlopen('libfunc.dll')
cfunc=LIB['cfunc','ISi'] # int cfunc(char *data,int *num)
---------------------------------------
After typing in irb, I typed them like this.
len=DL.malloc(DL.sizeof("I"))
err=cfunc.call("hello",len)
But, error message is displayed like the belows.
"TypeError: can't convert DL:trData into Integer"
I'm not sure how to solve the problem.
Please let me know the reason and solutions for novice like me.
It make me crazy.
Then, Thank you in advance.