From: Charlie Savage Date: 2011-08-17T14:48:59+09:00 Subject: [ruby-core:39003] [Ruby 1.9 - Bug #5193] ruby_thread_data_type linker errors fixed with RUBY_EXTERN Issue #5193 has been updated by Charlie Savage. rb_thread_t is *not* public. ruby-debug-base includes vm_core.h directly to get access to rb_thread_t. So I would guess the developers are well aware that it could change at any time. But given the alternative of no debugger at all, that seems like a good risk (note that ruby-debug is the ruby debugger for RubyMine, Netbeans, Eclipse/Aptana and probably any other IDE that is used for Ruby). So back to the original request. ruby_thread_data_type is already marked as extern and is already publicly exported via the *.def file generated when compiling ruby from source. But even with this, it doesn't work on VC++ unless the extern is changed to RUBY_EXTERN (because RUBY_EXTERN becomes __declpec(dllimport) when used by a client). Thanks, Charlie ---------------------------------------- Bug #5193: ruby_thread_data_type linker errors fixed with RUBY_EXTERN http://redmine.ruby-lang.org/issues/5193 Author: Charlie Savage Status: Assigned Priority: Normal Assignee: Nobuyoshi Nakada Category: core Target version: 1.9.3 ruby -v: - ruby-debug-base19x fails to compile with VC++ 2010 with this error: ruby_debug.obj : error LNK2001: unresolved external symbol _ruby_thread_data_type ruby_thread_data_type is declared in vm_core.h as: extern const rb_data_type_t ruby_thread_data_type; ruby-debug calls GetThreadPtr which is defined as: #define GetThreadPtr(obj, ptr) \ TypedData_Get_Struct((obj), rb_thread_t, &ruby_thread_data_type, (ptr)) What makes this interesting is that ruby_thread_data_type is properly included in the msvcr100-ruby191.def file and is exported from msvcr100-ruby191.dll. Somehow the &ruby_thread_data_type causes problems for VC++ (mingw works correctly). Some Ubuntu users seem to be having a similar issue. See: http://rubyforge.org/tracker/index.php?func=detail&aid=29222&group_id=8883&atid=34290 The problem is resolved for VC++ by changing the definition to: RUBY_EXTERN const rb_data_type_t ruby_thread_data_type; Any chance this change could be made? Thanks - Charlie -- http://redmine.ruby-lang.org