./configure
make
make install
ruby extconf.rb --with-charguess-include=../libcharguess/cpp/
ghost@ghost-laptop:~/rb/libcharguess-ruby-1.0$ make
cc -shared -o charguess.so charguess.o -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -lruby1.8 -lstdc++ -lcharguess -lpthread -ldl -lcrypt -lm -lc
/usr/bin/ld: /usr/local/lib/libcharguess.a(charguess.o): relocation R_X86_64_32 against `__gxx_personality_v0@@CXXABI_1.3' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libcharguess.a: could not read symbols: Bad value
collect2: ld 返回 1
make: *** [charguess.so] 错误 1
编译charguess.so时出现的错语
- Ragingflames
- 帖子: 89
- 注册时间: 2006-09-08 19:59
- sevk
- 帖子: 2060
- 注册时间: 2007-05-08 16:26
- 系统: arch
- 来自: 火星内核某分子内某原子核内
- 联系:
Re: 编译charguess.so时出现的错语
最近找到个gem的替换品,完美的.
http://www.ruby-lang.org.cn/forums/thread-601-1-1.html
代码: 全选
gem install rchardet
$irb
irb(main):001:0> require 'rchardet'
=> true
irb(main):002:0> CharDet.detect("\xA4\xCF")
=> {"encoding"=>"EUC-JP", "confidence"=>0.99}
irb(main):003:0> require 'rchardet'
=> true
irb(main):004:0> CharDet.detect("中国")["encoding"]
=> "utf-8"
笔记本 :
F208S : gentoo
A460P i3G D6 : UBUNTU + WIN7
UN43D1 : UBUNTU + WIN7
1000人超级QQ群 LINUX + WIN : 31465544 或 18210387
F208S : gentoo
A460P i3G D6 : UBUNTU + WIN7
UN43D1 : UBUNTU + WIN7
1000人超级QQ群 LINUX + WIN : 31465544 或 18210387