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

Discussion in 'Ruby' started by bbmerong, Jan 17, 2008.

  1. bbmerong

    bbmerong Guest

    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.
    bbmerong, Jan 17, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. grbgooglefan
    Replies:
    2
    Views:
    411
    Pascal Bourguignon
    Jan 30, 2008
  2. grbgooglefan
    Replies:
    4
    Views:
    430
    Kenny McCormack
    Jan 30, 2008
  3. grbgooglefan
    Replies:
    0
    Views:
    384
    grbgooglefan
    Jan 30, 2008
  4. Alok
    Replies:
    3
    Views:
    241
  5. THAKUR PRASHANT SINGH

    Class Function call vs Normal Function call

    THAKUR PRASHANT SINGH, Feb 26, 2010, in forum: Ruby
    Replies:
    7
    Views:
    174
    THAKUR PRASHANT SINGH
    Feb 27, 2010
Loading...

Share This Page