我想從Cygwin下的Win7 x64下的sctraches編譯ruby 1.9.2-p0。一切幾乎沒有問題,所有的擴展都編譯了,直到它到達win32ole 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 -o -s ../../.ext/i386-cygwin/win32ole.so win32ole.o - L. -二。輪候冊, - 啓用 - 自動圖像基地, - 使能自動導入-lruby191 -ladvapi32 -lkernel32 -luser32 -luuid -loleaut32 -lole32 -lpthread -lrt -ldl -lcrypt
我不不知道爲什麼會發生這種情況(可能是頭文件資源不可用),但我其實並不在乎這個擴展(我不認爲我會使用它),所以我想知道如何禁用擴展名爲的win32ole從make
階段,只需跳過它。
我想有一種方式,但我不知道如何..
在此先感謝!
所以它應該只是'--with-out-ext = win32ole'?因爲我搜索文件的擴展名列表,但無法找到它 – Jack 2010-11-16 17:37:51
在這種情況下,它應該足以將mlang.dll內cygwin斌文件夾或system32我想..(剛剛檢查,我已經在system32中有這個dll,我真的不明白爲什麼會發生這種情況) – Jack 2010-11-16 17:41:41
任何文件中都沒有擴展名列表,只是ext目錄的內容。您可以查看ext/extmk.rb,瞭解如何處理這些參數,如果您好奇的話。 – 2010-11-16 17:43:24