March 16, 2005

C++ sucks!

話說 clkao 長輩最近試著使用 ports 上的 SCIM-chewing,可是發現酷音叫不出來,在 #bsdchat 上追了很久,終於發現問題的癥結,引述 irc log 如下:
    01:46 <@clkao> _but_ chewing wants the symbol, though grepping the source odnes't show that up
    01:48 <@clkao> ab# nm /usr/X11R6/lib/scim-1.0/IMEngine/chewing.so |grep inver
    01:48 <@clkao> U _ZN4scim19IMEngineFactoryBase13inverse_queryERKSbIjSt11char_traitsIjESaIjEE
    01:48 <@clkao> WTF
    01:49 < koster> 好奇怪 *_*
    01:50 <@clkao> probably WideString doesn't have the same signature during the two compilation
    01:53 <@jserv> c++filt _ZN4scim19IMEngineFactoryBase13inverse_queryERKSbIjSt11char_traitsIjESaIjEE
    01:53 <@jserv> scim::IMEngineFactoryBase::inverse_query(std::basic_string, std::allocator > const&)
    01:53 <@jserv> C++ sucks.
    01:53 <@clkao> HATE
    01:55 < leafy> system compiler bah
    01:55 <@clkao> so it's wchar_t vs unsigned int
    01:56 < leafy> in chewing it becomes unsigned
    01:57 <@clkao> ok
    01:57 <@clkao> must include src/scim_types.h
    01:58 <@jserv> 看來要加上 -Wall
    01:58 <@jserv> 不然會有這種鳥事發生 :(
    01:59 <@clkao> :(
    01:59 < koster> add #define Uses_SCIM_TYPES
    01:59 <@jserv> 白爛事交給白蘭氏 XD
    02:00 <@clkao> doesn't work
    02:01 <@clkao> #define __STDC_ISO_10646__
    02:02 <@clkao> now it _works_
    02:02 <@clkao> hate
    02:17 <@jserv> How can such a workaround drive people being crazy for days?!
    02:17 <@jserv> My God!
    02:17 <@clkao> http://nopaste.snit.ch:8002/2044
    02:18 <@clkao> because 1. scim doesn't complain about unresolvable symbols
    02:18 <@clkao> 2. c++ sucks
    02:18 <@clkao> 3. people are lazy
    02:18 <@clkao> leafy: (!) HATE!
這個 workaround 雖然看起來只修正一點點,但是可讓 clkao 長輩抓狂很久,C++ 實在是複雜到不行,讓人實在忍不住大聲喊:
    C++ sucks!
由 jserv 發表於 March 16, 2005 02:56 AM
迴響

scim_types.h should be included automatically, if scim.h is included. So there should be no such problem if you compile scim and scim-chewing by the same compiler.

James Su 發表於 March 16, 2005 12:31 PM