【问题标题】:"error: size of array 'ruby_check_sizeof_voidp' is negative" when building MySQL Connector“错误:数组'ruby_check_sizeof_voidp'的大小为负”构建MySQL连接器时
【发布时间】:2013-06-18 03:11:11
【问题描述】:
> c:\Ruby193>ruby -v > 红宝石 1.9.3p429 (2013-05-15) [i386-mingw32] > c:\Ruby193>rails -v > 导轨 3.2.13 > c:\mysql-connector-c-noinstall-6.0.2-winx64 > 这是问题: > C:/Ruby193/bin/ruby.exe extconf.rb > 创建 Makefile > 制作 >> 生成生成器-i386-mingw32.def > 编译生成器.c > 在来自 c:/Ruby193/include/ruby-1.9.1/ruby.h:32:0 的文件中, > 来自 ../fbuffer/fbuffer.h:5, > 来自生成器.c:1: > c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:109:14: 错误:数组大小 > 'ruby_check_sizeof_voidp' 是负数 > 在来自 c:/Ruby193/include/ruby-1.9.1/ruby.h:32:0 的文件中, > 来自 ../fbuffer/fbuffer.h:5, > 来自生成器.c:1: > c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:在函数“rb_class_of”中: > c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1333:12: 警告:从不同大小的整数> 转换为指针 [-Wint-> to-pointer-cast] > c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:在函数“rb_type”中: > c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1349:12: 警告:从不同大小的整数 > 转换为指针 [-Wint-> to-pointer-cast] > 在来自 c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1381:0 的文件中, > 来自 c:/Ruby193/include/ruby-1.9.1/ruby.h:32, > 来自 ../fbuffer/fbuffer.h:5, > 来自生成器.c:1: > c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:在顶层: > c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:44:8: 错误:重新定义'struct > 时间规格' > 在来自 c:\ruby193\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../.. 的文件中 > /../../x86_64-w64-> mingw32/include/process.h:12:0, > 来自 c:/Ruby193/include/ruby-1.9.1/ruby/win32.h:62, > 来自 c:/Ruby193/include/ruby-1.9.1/ruby/defines.h:223, > 来自 c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:67, > 来自 c:/Ruby193/include/ruby-1.9.1/ruby.h:32, > 来自 ../fbuffer/fbuffer.h:5, > 来自生成器.c:1: > c:\ruby193\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32 > /include/sys/types.h:89:8: > 注意:最初定义在这里 > 在来自 c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:1381:0 的文件中, > 来自 c:/Ruby193/include/ruby-1.9.1/ruby.h:32, > 来自 ../fbuffer/fbuffer.h:5, > 来自生成器.c:1: > c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:51:8: 错误: 'struct 的重新定义 > 时区' > 在来自 c:/Ruby193/include/ruby-1.9.1/ruby/win32.h:63:0 的文件中, > 来自 c:/Ruby193/include/ruby-1.9.1/ruby/defines.h:223, > 来自 c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:67, > 来自 c:/Ruby193/include/ruby-1.9.1/ruby.h:32, > 来自 ../fbuffer/fbuffer.h:5, > 来自生成器.c:1: > c:\ruby193\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32 > /include/time.h:260:8: 注意:> 最初定义在这里 > 在 generator.c:1:0 包含的文件中: > ../fbuffer/fbuffer.h:在函数“fbuffer_append_str”中: > ../fbuffer/fbuffer.h:118:25:警告:从不同大小的整数转换为指针 > [-Wint-to-pointer-cast] > ../fbuffer/fbuffer.h:118:25:警告:从不同大小的整数转换为指针 > [-Wint-to-pointer-cast] > generator.c:在函数“convert_UTF8_to_JSON_ASCII”中: > generator.c:129:35: 警告:从不同大小的整数转换为指针 [-Wint- > 指向指针] > generator.c:130:38:警告:从不同大小的整数转换为指针 [-Wint- > to-pointer-cast] > generator.c:在函数“convert_UTF8_to_JSON”中: > generator.c:227:23: 警告:从不同大小的整数转换为指针 [-Wint- > to-pointer-cast] > generator.c:228:25: 警告:从不同大小的整数转换为指针 [-Wint- > to-pointer-cast]

任何帮助都会有所帮助。

【问题讨论】:

  • this 可能会有所帮助
  • 请更新 WinKit

标签: ruby-on-rails ruby windows mysql-connector


【解决方案1】:

DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe 的快速修复

“禁用”c:/Ruby193/include/ruby-1.9.1/ruby/missing.h:44 中的结构定义

...
#if 0 && !defined(HAVE_STRUCT_TIMESPEC)
...
#if 0 && !defined(HAVE_STRUCT_TIMEZONE)
...

适用于我 Win7-x64/Ruby193-x32

【讨论】:

    【解决方案2】:

    我在这里搜索“错误:'struct timespec' 的重新定义”。最终我发现我使用的是 Ruby 2 和 Ruby 1.9 的 devkit 版本。我从这里下载了正确版本的 devkit:http://rubyinstaller.org/downloads/,现在一切正常。认为这些信息可能会对未来的用户有所帮助。

    【讨论】:

      猜你喜欢
      • 2013-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-14
      • 1970-01-01
      • 1970-01-01
      • 2018-04-01
      • 2019-08-10
      相关资源
      最近更新 更多