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

**URL:** <https://www.ruby-forum.com/t/int-cfunc-void-how-can-i-call-this-function-with-ruby-dl/126298>\
**Category:** Ruby\
**Created:** [January 17, 2008, 5:41am UTC](https://www.ruby-forum.com/t/int-cfunc-void-how-can-i-call-this-function-with-ruby-dl/126298 "2008-01-17T05:41:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbmerong](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ce7236/32.png) [@bbmerong](https://www.ruby-forum.com/u/bbmerong)\
**Post date:** [January 17, 2008, 5:41am UTC](https://www.ruby-forum.com/t/int-cfunc-void-how-can-i-call-this-function-with-ruby-dl/126298/1 "2008-01-17T05:41:49Z")

</div>

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.
