> static VALUE m_RunWithTimeout(VALUE rStr) > { > char* cStr; > cStr = STR2CSTR(rStr); > printf("%s",cStr); > } The first argument to a module function is always going to be the module object itself; so for this function (which you expect to take a single string argument) you really need to list two arguments, e.g. static VALUE m_RunWithTimeout(VALUE rModule, VALUE rStr) { char* cStr; cStr = STR2CSTR(rStr); printf("%s",cStr); } Leave everything else the way you had it, and this should do the trick.