禁用ruby扩展

禁用ruby扩展,ruby,cygwin,Ruby,Cygwin,我正在尝试使用Cygwin从Win7 x64下的sctraches编译ruby 1.9.2-p0。。一切都很顺利,所有扩展都被编译,直到它到达win32ole ext,该ext失败并出现以下错误: win32ole.o: In function `load_conv_function51932': /home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:934: undefined reference to `_CLSID_CMultiLanguage'

我正在尝试使用Cygwin从Win7 x64下的sctraches编译ruby 1.9.2-p0。。一切都很顺利,所有扩展都被编译,直到它到达win32ole ext,该ext失败并出现以下错误:

win32ole.o: In function `load_conv_function51932':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:934: undefined reference to `_CLSID_CMultiLanguage'
win32ole.o: In function `fole_activex_initialize':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:4762: undefined reference to `_IID_IPersistMemory'
win32ole.o: In function `mf_QueryInterface':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:597: undefined reference to `_IID_IUnknown'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:597: undefined reference to `_IID_IMessageFilter'
win32ole.o: In function `QueryInterface':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:699: undefined reference to `_IID_IUnknown'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:699: undefined reference to `_IID_IDispatch'
win32ole.o: In function `EVENTSINK_QueryInterface':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:7571: undefined reference to `_IID_IUnknown'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:7571: undefined reference to `_IID_IDispatch'
win32ole.o: In function `fole_each':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:4014: undefined reference to `_GUID_NULL'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:4031: undefined reference to `_IID_IEnumVARIANT'
win32ole.o: In function `load_conv_function51932':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:934: undefined reference to `_CLSID_CMultiLanguage'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:934: undefined reference to `_CLSID_CMultiLanguage'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:934: undefined reference to `_CLSID_CMultiLanguage'
win32ole.o: In function `find_default_source':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:8174: undefined reference to `_IID_IProvideClassInfo2'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:8190: undefined reference to `_IID_IProvideClassInfo'
win32ole.o: In function `ev_advise':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:8308: undefined reference to `_IID_IConnectionPointContainer'
win32ole.o: In function `load_conv_function51932':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:934: undefined reference to `_CLSID_CMultiLanguage'
win32ole.o: In function `ole_create_dcom':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:2615: undefined reference to `_IID_IDispatch'
win32ole.o: In function `fole_initialize':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:3248: undefined reference to `_IID_IDispatch'
win32ole.o: In function `load_conv_function51932':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:934: undefined reference to `_CLSID_CMultiLanguage'
win32ole.o: In function `fole_respond_to':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:4516: undefined reference to `_GUID_NULL'
win32ole.o: In function `ole_variant2val':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:2262: undefined reference to `_IID_IDispatch'
win32ole.o: In function `ole_invoke':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:3392: undefined reference to `_GUID_NULL'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:3450: undefined reference to `_GUID_NULL'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:3364: undefined reference to `_GUID_NULL'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:3467: undefined reference to `_GUID_NULL'
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:3506: undefined reference to `_GUID_NULL'
win32ole.o:/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:3481: more undefined references to `_GUID_NULL' follow
win32ole.o: In function `fole_s_connect':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:2718: undefined reference to `_IID_IDispatch'
win32ole.o: In function `ole_bind_obj':
/home/Jack/ruby-1.9.2-p0/ext/win32ole/win32ole.c:2656: undefined reference to `_IID_IDispatch'
collect2: ld returned 1 exit status
make: *** [../../.ext/i386-cygwin/win32ole.so] Error 1
makefile使用以下选项通过gcc构建它:

gcc-shared-s-o../.ext/i386 cygwin/win32ole.so win32ole.o-L-L../-L.-Wl,--启用自动映像库,--启用自动导入-lruby191-ladvapi32-lkernel32-luer32-luuid-loleaut32-lole32-lpthread-lrt-ldl-lcrypt

我不知道为什么会发生这种情况(可能是头资源不可用),但实际上我并不太关心这个扩展(我不认为我会使用它),所以我想知道如何从
make
阶段禁用win32ole扩展并跳过它

我想有办法,但我不知道怎么办

提前谢谢

执行
/configure--help
并记下选项

--with-exts=EXTS
--with-out-ext=EXTS
我有相同的设置,使用cygwin 1.7赢得7 x86_64,构建该扩展没有问题。gcc命令行与您的命令行相同。我想Microsoft文档中提到了一个可以检查的mlang.dll。

执行
/configure--help
并注意选项

--with-exts=EXTS
--with-out-ext=EXTS

我有相同的设置,使用cygwin 1.7赢得7 x86_64,构建该扩展没有问题。gcc命令行与您的命令行相同。我想Microsoft文档提到了一个可以检查的mlang.dll。

我遇到了同样的问题。我不知道./configure选项。经过各种探索和测试,我只是将win32ole目录移到一边,这似乎是可行的。

我遇到了同样的问题。我不知道./configure选项。经过各种探索和测试,我只是将win32ole目录移到一边,这似乎是可行的。

这可以在不禁用扩展的情况下修复

此操作失败的原因是链接时间错误。这与系统路径上存在哪些DLL无关-这将在运行时引发问题。我在安装cygwin 1.7.9-1后遇到了这个问题。安装cygwin/usr/lib后,包含库文件libuuid.*的链接存根将具有相同名称的文件隐藏在/usr/lib/w32api中,该链接存根与windows API DLL接口。这些是ruby扩展代码的预期目标。这可能是因为它们最近被添加到cygwin发行版,也可能是因为我选择的某个包包含了这些文件。在运行configure之后,我在ruby源代码的ext/w32ole下的Makefile中将LIBPATH=-L.-L$(topdir)行更改为LIBPATH=-L.-L$(topdir)-L/usr/lib/w32api,以使链接器能够在运行configure之后找到正确的库文件


请注意,在第一次运行“make”之前,ext/w32ole/Makefile不可见。一旦执行此操作,Makefile将可见并可进行调整。第二次运行“make”时应该不会出现错误。

这可以在不禁用扩展的情况下修复

此操作失败的原因是链接时间错误。这与系统路径上存在哪些DLL无关-这将在运行时引发问题。我在安装cygwin 1.7.9-1后遇到了这个问题。安装cygwin/usr/lib后,包含库文件libuuid.*的链接存根将具有相同名称的文件隐藏在/usr/lib/w32api中,该链接存根与windows API DLL接口。这些是ruby扩展代码的预期目标。这可能是因为它们最近被添加到cygwin发行版,也可能是因为我选择的某个包包含了这些文件。在运行configure之后,我在ruby源代码的ext/w32ole下的Makefile中将LIBPATH=-L.-L$(topdir)行更改为LIBPATH=-L.-L$(topdir)-L/usr/lib/w32api,以使链接器能够在运行configure之后找到正确的库文件


请注意,在第一次运行“make”之前,ext/w32ole/Makefile不可见。一旦执行此操作,Makefile将可见并可进行调整。第二次运行“make”应该不会出现错误。

所以它应该是
——没有ext=win32ole
?因为我在文件中搜索了扩展名列表,但没有找到,所以在这种情况下,应该可以将mlang.dll放在cygwin bin文件夹或system32中。。(刚刚检查过,我在system32中已经有了dll,我真的不明白为什么会发生这种情况)任何文件中都没有扩展名列表,只有ext目录内容。如果您好奇的话,可以查看ext/extmk.rb以了解这些参数是如何处理的。因此,它应该是
——不带ext=win32ole
?因为我在文件中搜索了扩展名列表,但没有找到,所以在这种情况下,应该可以将mlang.dll放在cygwin bin文件夹或system32中。。(刚刚检查过,我在system32中已经有了dll,我真的不明白为什么会发生这种情况)任何文件中都没有扩展名列表,只有ext目录内容。如果您感兴趣,可以查看ext/extmk.rb以了解这些参数是如何处理的。此外,这可以通过
export LIBRARY\u PATH=/usr/lib/w32api:$LIBRARY\u PATH
(在此处找到的解决方案)来解决。此外,还可以通过
export LIBRARY\u PATH=/usr/lib/w32api:$LIBRARY\u PATH
(在此处找到的解决方案)来解决