scim-pinyin编译过程

原创 2010年01月10日 22:14:00

一、下载scim-pinyin-0.5.91和scim-1.4.9源码,并放在同一路径下,方便设置路径环境变量。

二、进入scim-pinyin-0.5.91源码,执行./configure,然后make,会出现如下错误:

 

Q1问题1:scim.pc找不到

checking for scim >= 1.2.0... Package scim was not found in the pkg-config search path. Perhaps you should add the directory containing `scim.pc' to the PKG_CONFIG_PATH environment variable No package 'scim' found
configure: error: Library requirements (scim >= 1.2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

 

A1解决方案:

将scim-1.4.9源码下的scim.pc拷贝至pinyin源码目录下,并设置环境变量export PKG_CONFIG_PATH=./

修改scim.pc文件:

  1 prefix=/usr
  2 exec_prefix=${prefix}
  3 libdir=${exec_prefix}/lib
  4 includedir=${prefix}/include
  5 localedir=${prefix}/share/locale
  6 datadir=${prefix}/share
  7 sysconfdir=${prefix}/etc
  8
  9 scimdatadir=${prefix}/share/scim
 10 icondir=${prefix}/share/scim/icons
 11 moduledir=${exec_prefix}/lib/scim-1.0/1.4.0
 12
 13 scim_binary_version=1.4.0
 14
 15 Name: SCIM
 16 Description: Smart Common Input Method platform
 17 Version: 1.4.9
 18 Requires:
 19 Libs: -L${libdir} -lscim-1.0
 20 Cflags: -I/home/san/Desktop/samba/inputmethod/scim/scim-1.4.9/src

 

Q2问题2: scim.h头文件找不到

scim_pinyin_imengine.cpp:36:18: error: scim.h: No such file or directory


A2解决方案:

 

20 Cflags: -I/home/san/Desktop/samba/inputmethod/scim/scim-1.4.9/src

 

Q3问题3:标准库找不到

scim_pinyin.cpp: In member function 'void PinyinValidator::initialize(const PinyinTable*)':
scim_pinyin.cpp:687: error: 'memset' was not declared in this scope
scim_pinyin.cpp: In member function 'virtual int PinyinDefaultParser::parse_one_key(const PinyinValidator&, PinyinKey&, const char*, int) const':
scim_pinyin.cpp:829: error: 'strlen' was not declared in this scope
scim_pinyin.cpp: In member function 'virtual int PinyinDefaultParser::parse(const PinyinValidator&, PinyinParsedKeyVector&, const char*, int) const':
scim_pinyin.cpp:882: error: 'strlen' was not declared in this scope
scim_pinyin.cpp: In member function 'int PinyinDefaultParser::parse_initial(PinyinInitial&, const char*, int) const':
scim_pinyin.cpp:1027: error: 'strlen' was not declared in this scope
scim_pinyin.cpp: In member function 'int PinyinDefaultParser::parse_final(PinyinFinal&, const char*, int) const':
scim_pinyin.cpp:1060: error: 'strlen' was not declared in this scope
scim_pinyin.cpp: In member function 'virtual int PinyinShuangPinParser::parse_one_key(const PinyinValidator&, PinyinKey&, const char*, int) const':
scim_pinyin.cpp:1113: error: 'strlen' was not declared in this scope
scim_pinyin.cpp: In member function 'virtual int PinyinShuangPinParser::parse(const PinyinValidator&, PinyinParsedKeyVector&, const char*, int) const':
scim_pinyin.cpp:1206: error: 'strlen' was not declared in this scope
scim_pinyin.cpp: In member function 'bool PinyinTable::input(std::istream&)':
scim_pinyin.cpp:1569: error: 'strlen' was not declared in this scope
scim_pinyin.cpp:1569: error: 'strncmp' was not declared in this scope
scim_pinyin.cpp:1580: error: 'strlen' was not declared in this scope
scim_pinyin.cpp:1580: error: 'strncmp' was not declared in this scope

 

A3解决方案:

在scim_pinyin.cpp中包含cstring头文件

  30 #define Uses_C_STRING
  31
  32 #include <scim.h>
  33 #include "scim_pinyin.h"


类似的还有scim_phrase.cpp、scim_pinyin_phrase.cpp和scim_special_table.cpp。


Q4问题4:找不到动态连接库libscim-1.0.so

g++ -shared -nostdlib /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.3.3/crtbeginS.o  .libs/pinyin_la-scim_pinyin_imengine.o -Wl,--whole-archive ./.libs/libpinyin.a -Wl,--no-whole-archive  -lscim-1.0 -L/usr/lib/gcc/i486-linux-gnu/4.3.3 -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/i486-linux-gnu/4.3.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/i486-linux-gnu/4.3.3/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crtn.o  -Wl,-soname -Wl,pinyin.so -Wl,-retain-symbols-file -Wl,.libs/pinyin.exp -o .libs/pinyin.so
/usr/bin/ld: cannot find -lscim-1.0


解决方案:

export LD_LIBRARY_PATH=/home/san/Desktop/samba/inputmethod/scim/scim-1.4.9/src/.libs/

注意:只能用绝对路径!

相关文章推荐

SCIM Smart Pinyin disappearing or can't be selectable.

If you use SCIM Smart Pinyin (智能拼音), you’ll know that every now and then it decides to stop working ...

Android 源码编译过程

  • 2014年05月13日 09:55
  • 204KB
  • 下载

一个C程序的编译过程(Linux环境下Gcc)

一 以下是C程序一般的编译过程:  从图中看到:      将编写的一个c程序(源代码)转换成可以在硬件上运行的程序(可执行代码),需要进行编译阶段  和链接这两个阶段。      其中,      ...

Qtopia的编译过程

  • 2010年02月25日 01:19
  • 770KB
  • 下载

cocos2d-x在Android上的编译过程(3):简化Android.mk文件的编写

由于cocos2d-x引擎中自带的那些Android.mk都是用比较繁琐的方式编写,那么dui

qt5+qgis2.14编译过程工具及库x86

  • 2017年06月28日 01:02
  • 41.7MB
  • 下载

Qt4.6.3编译过程

  • 2013年06月10日 20:59
  • 609KB
  • 下载

Xcode编译过程中 的部分警告处理(后续更新)

一个有节操的程序员会在乎自己的代码的警告,就像在乎饭碗边上有只死蟑螂那样。——@onevca Xcode编译过程中 ,有些警告,虽然有时不影响程序的运行,看起来很揪心。我们应该有足够的重视,因为这是程...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:scim-pinyin编译过程
举报原因:
原因补充:

(最多只允许输入30个字)