rubyºÍMinGWµÄÒ»´ÎÈÚºÏ
ÎÒÃÇÔÚʹÓÃC±à³Ìʱ»áÓöµ½Ò»¸öÎÊÌ⣬±ÈÈçÍ·ÎļþµÄÒ»¸öº¯Êý°üº¬ÔÚÒ»¸ölibÖУ¬µ«ÊÇ
ÔÚʵ¼ÊÁ¬½ÓÖÐÎÒÃDz»ÖªµÀËüÔÚÄĸö¿âÖС£Ò²Ðí¿ÉÐеÄÒ»ÖÖ°ì·¨ÊÇÖ±½ÓÉÏÍø²éѯij¸ö
º¯ÊýµÄÒÀÀµÌõ¼þ£¬Õâ¶ÔÓÚ³£Óú¯ÊýÊÇûÎÊÌâµÄ£¡µ«ÊǶÔÓÚ¸´ÔÓ¶øÓÖȱÉÙÎĵµµÄµÚÈý·½
libÀ´Ëµ£¬ÎÞÒìÓÚ´óº£ÀÌÕë¡£
×Ô´Ëͨ¹ý2ÖÖ°ì·¨À´³¢ÊÔ½â¾öÕâ¸öÎÊÌ⣬ÎÒÃÇÏÈ¿´µÚÒ»ÖÖ£º
ÔÚWindowsÏÂʹÓÃÅú´¦ÀíÓïÑÔÀ´²éÕÒÖ¸¶¨µÄº¯Êý·ûºÅ:
crt.bat:
@echo off
set gccpath=d:\downloadsvr\mingwstudio\mingw
dir %gccpath%\lib /b>files.txt
if not exist files md files
for /f %%i in (files.txt) DO (
set fprefix=%%i
%gccpath%\bin\nm.exe -s -D %gccpath%\lib\%%i>files\%%i.txt
for %%a in (files\%%i.txt) do (
if %%~za equ 0 del %%a
)
)
del files.txt
@echo ######## Create Names Database Successed!!! #########
pause
;#################################################################
fnd.bat:
@echo off
dir files\ /b >tmp.txt
for /f %%i in (tmp.txt) DO (
find /i /n "%1" files\%%i
)
del tmp.txt
ÒÔÉÏÓÐ2¸öbatÎļþ£¬crt.batÊÇÉú³É¶ÔÓ¦libÎļþ¼ÐÖеÄËùÓÐlibµÄ·ûºÅ£¬·Ö±ð·ÅÔÚÈô¸É¸öÎı¾
ÎļþÖС£Ö»Òªlib²»·¢Éú±ä¶¯£¬ÄÇôֻҪÉú³ÉÒ»´Î¼´¿É£¡È»ºóʹÓÃfnd.batÀ´²éѯij¸ö·ûºÅ¡£
that's all£¡£¡£¡
ÄÇôʹÓÃrubyÄÜ·ñÍê³ÉÕâÒ»¹¦ÄÜÄØ£¿´ð°¸Êǿ϶¨µÄ£º
class LibSyms
attr_accessor :libs
def save_syms(fname="cache_syms.dat")
data = Marshal.dump(@syms)
File.open(fname,"w+b") {|f|f.puts data}
end
def load_syms(fname="cache_syms.dat")
data=nil
File.open(fname,"r+b"){|f|data=f.read}
@syms=Marshal.load(data)
end
def enum_syms
@syms={}
@libs = []
`dir \"#{@path}\\lib\" /b`.lines {|line|@libs<<@path+"\\lib\\"+line.chomp}
@libs.each do |fname|
tmp=`\"#{@path}\\bin\\nm.exe\" -s -D \"#{fname}\"`.split("\n")
@syms[fname]=tmp
end
end
def initial
Ïà¹ØÎĵµ£º
When I try the command "gem install thrift" with Ruby 1.9.1, I got a compilation error with something related to a C function "strlcpy()".
Then I searched the web. It seems I am not alone and the community know it.
However I do not want to wait for official update, I want to ......
ÀúÊ·±³¾°£Û1£Ý
µ®ÉúÓÚ1993Äê2ÔÂ24ÈÕµÄRuby(ºì±¦Ê¯)£¬ÓÉÈÕ±¾ÈËËɱ¾Ðк루Yuki Matsumoto£©ÓÚ1994Äê12Ô·¢²¼¡£ Ruby ×÷ΪһÖÖ´¿ÃæÏò¶ÔÏóµÄ½Å±¾³ÌÐòÉè¼ÆÓïÑÔ£¬ÎüÊÕÁËSmalltalkºÍPerlÁ½ÖÖ³ÌÐòÓïÑÔµÄÌØÐÔ¡£
RubyÀíÄî£Û2£Ý
1.Ê×ÏÈ¿¼ÂǵÄÊÇ£¬¼õÉÙ±à³Ìʱ²»±ØÒªµÄËöËéʱ¼ä£¬Áî±àд³ÌÐòµÄÈ˸ßÐË£»
2.Æä´ÎÊÇÁ¼ºÃµÄ½çÃæÉè¼Æ£»
3.Ç¿ ......
Ruby£¬Ò»ÖÖ為簡單¿ì½ÝÎï¼þ導Ïò編³Ì£¨ÃæÏò¶ÔÏó³ÌÐòÉè¼Æ£©¶ø創µÄ½Å±¾語ÑÔ£¬ÔÚ20ÊÀ¼Í90Äê´úÓÉÈÕ±¾ÈËËɱ¾Ðк루¤Þ¤Ä¤â¤È¤æ¤¤Ò¤í£¯Yukihiro Matsumoto£©¿ª·¢£¬×ñÊØGPLÐÒéºÍRuby License¡£ËüµÄÁé¸ÐÓëÌØÐÔÀ´×ÔÓÚPerl¡¢Smalltalk¡¢Eiffel¡¢Ada ÒÔ¼° Lisp ......
¡¡×î½ü£¬ÎÒÐèÒªÒ»ÖÖ¿ìËÙ¿ª·¢ÓïÑÔ£¬Ä¿Ç°ÖËÊÖ¿ÉÈȵĿìËÙ¿ª·¢ÓïÑÔ¾ÍÊÇPythonºÍRubyÁË¡£RubyºÍPython¶¼ÊǷdz£ÓÅÐãµÄ½Å±¾ÓïÑÔ£¬ËäÈ»ËûÃǵÄÉè¼ÆÕÜѧ¼¸ºõÍêÈ«²»Í¬£¬µ«ËûÃÇЧÂʲ¶à£¬Ó¦ÓÃÁìÓòÒ²²î¾à²»´ó£¬ËƺõÌìÉú¾ÍÊǾºÕù¶ÔÊÖ¡£µ½µ×Ñ¡ÄǸöÄØ?ÎÒ×öÁËһЩ¼òµ¥µÄ±È½Ï¡£
¡¡¡¡ÎÒÃDZȽ ......
Õý³£Çé¿öÏ£¬rubyÈç¹û·¢ÏÖÎļþ¼ÐÖÐÓÐsystem£¬readonly£¬hideÀàÐ͵ÄÎļþ£¬ÔòÊDz»ÄÜÖ±½Óɾ³ý
ËûÃǵġ£ÈçºÎ½â¾öÄØ£¿
ÒÔÆäÈËÖ®µÀ»¹ÖÎÆäÈËÖ®Éí£¡
def dryf(fpath) #destroy file
x = Iconv.iconv('utf-8','gbk',fpath).to_s
%x{attrib -R -S -H \"#{Iconv.iconv('gbk','utf-8',x).to_s}\"}
f = File.new(f ......