22 06, 2005

rubyÀ©Õ¹cÎļþÃû»¹²»ÄÜÓÃcpp

Ò»¸öºÜ¼òµ¥µÄÎļþ£¬¾ÍÊÇprogramming ruby ÉϵÄÀý×Ó£¨http://www.ruby-cn.org/book/ProgrammingRuby/ext_ruby.html£©£¬Èç¹ûÀ©Õ¹ÃûÊÇcpp£¬Ôò³öÏÖÕâÑùµÄ´íÎó£º

error C2664: 'rb_define_method' : cannot convert parameter 3 from
'unsigned long (unsigned long)' to 'unsigned long (__cdecl *)(...)'
None of the functions with this name in scope match the target type

ÐèÒª¸Ä³É.cµÄÎļþ²ÅÐС£

Èç¹û·ÇÒªÓÃcpp£¬¿ÉÒÔÐÞ¸ÄÈçÏ£º

rb_define_method(cTest, "initialize", RUBY_METHOD_FUNC(t_init), 0);
rb_define_method(cTest, "add", RUBY_METHOD_FUNC(t_add), 1);


×îлظ´