>
> `extern __declspec(dllimport)` would be required for VC.
> Here is a patch.
>
>
> diff --git a/ext/dbm/dbm.c b/ext/dbm/dbm.c
> index 83db7cb..4b177e6 100644
> --- a/ext/dbm/dbm.c
> +++ b/ext/dbm/dbm.c
> @@ -1086,7 +1086,7 @@ Init_dbm(void)
>       /* ndbm.h doesn't declare gdbm_version until gdbm 1.8.3.
>        * See extconf.rb for more information. */
>       {
> -        extern char *gdbm_version;
> +        RUBY_EXTERN char *gdbm_version;
>           rb_define_const(rb_cDBM, "VERSION",  rb_str_new2(gdbm_version));
>       }
>   #elif defined(HAVE_DPVERSION)

Please commit it.