"int cfunc(void) " how can I call this function with "ruby/dl'

B

bbmerong

In ruby/dl (win32)

I define the function like the belows.

------------------------

require 'dl'
libc=DL.open("libfunc.dll")
func=libc['func_test','IO'] # int func_test(void);


-------------------------
Then, I typed in irb like the belows.

func.call()

But the error message is displayed

'1 arguments are need'

So, I type in irb like this

func.call(nil)

But, the error message is also displayed.

'DL::DLTypeError: unknown type '0' of the return value.'

I'm not sure how to call this function in ruby/dl

Please let me know the reason and solutions.

Thank you in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top