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的安装配置

声明:本文转载自http://blog.sina.com.cn/u/4b721ac3010006bp,作了小小注解,其实已经很详细了,献给很多愿意使用rhel4,但不习惯其输入法在oo中乱蹦的朋友们,...
  • Challenge_C_PlusPlus
  • Challenge_C_PlusPlus
  • 2011年09月26日 21:31
  • 2122

SCIM输入法架构分析(下)

 SCIM输入法架构分析(下) 转载时请注明出处:http://blog.csdn.net/absurd/ 1.      概述SCIM是Smart Common Input Method的简称,它是...
  • absurd
  • absurd
  • 2006年08月31日 21:16
  • 9594

scim-pinyin编译过程

一、下载scim-pinyin-0.5.91和scim-1.4.9源码,并放在同一路径下,方便设置路径环境变量。二、进入scim-pinyin-0.5.91源码,执行./configure,然后mak...
  • sanlinux
  • sanlinux
  • 2010年01月10日 22:14
  • 7886

Debian下scim配置

中文输入法是Linux的一大软肋.我现在Debian GUN/Liunux 下使用scim, 不过在正常运行之前你需要一些步骤去做. 首先安装scim $sudo apt-get inst...
  • toddmi
  • toddmi
  • 2012年07月14日 10:52
  • 833

C语言编译过程详解

转自 C语言的编译链接过程要把我们编写的一个c程序(源代码)转换成可以在硬件上运行的程序(可执行代码),需要进行编译和链接。编译就是把文本形式源代码翻译为机器语言形式的目标文件的过程...
  • wdjhzw
  • wdjhzw
  • 2014年07月31日 14:55
  • 1468

SCIM输入法架构分析(上)

SCIM输入法架构分析(上) 转载时请注明出处:http://blog.csdn.net/absurd/ 文档格式与术语说明  1.      概述SCIM是Smart Common Input Me...
  • absurd
  • absurd
  • 2006年08月31日 20:51
  • 16909

scim-googlepinyin.tar.gz

  • 2011年07月09日 21:53
  • 2.26MB
  • 下载

Java代码编译过程简述

Javac编译器,能将一种语言规范转化成另外一种语言规范,通常编译器都是将便于人理解的语言规范转化成机器容易理解的语言规范,如C/C++或者汇编语言都是将源代码直接编译成目标机器码,这个目标机器代码是...
  • fuzhongmin05
  • fuzhongmin05
  • 2017年02月05日 11:31
  • 1620

C#编译过程图解

衷心要说一句话:蒋坤老师讲的太棒了,人间极品啊~~
  • u013905744
  • u013905744
  • 2015年06月22日 09:58
  • 1065

scim的输入法切换问题

 今天是使用ububtu的第二天,问题开始越来越多了,需要一个一个高定,象现在的这些字就是在linux下码的http://forum.ubuntu.org.cn/about22016.html&sid...
  • rf_wu
  • rf_wu
  • 2006年09月10日 14:10
  • 3127
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:scim-pinyin编译过程
举报原因:
原因补充:

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