ubuntu16.04 编译安装kscope

1. 下载kscope

https://jaist.dl.sourceforge.net/project/kscope/kscope/1.9.4/kscope-1.9.4.tar.gz

2. 编译并安装

$ qmake

$ make 


In file included from viscintilla.cpp:22:0:
viscintilla.h:26:27: fatal error: qsciscintilla.h: 没有那个文件或目录
compilation terminated.
Makefile.Release:252: recipe for target 'release/viscintilla.o' failed

出现上述错误安装:QScintilla

下载链接:https://ncu.dl.sourceforge.net/project/pyqt/QScintilla2/QScintilla-2.10.1/QScintilla_gpl-2.10.1.tar.gz

$ qmake

$ make


/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.


出现上述错误,需要修改Makefile,开启C11的支持。

$ vim  Makefile

在 CXXFLAGS 行添加 -std=gnu++11。

$ sudo make && make install

$ sudo ln -s ./qt4/Qsci ./Qsci

在安装时会把Qsci,安装到/usr/include/qt4/目录下,但在编译kscope时搜索的目录时/usr/include/Qsci,所以可以建立软连接解决上述问题。


2.1 重新编译安装

$ make


/usr/bin/ld: 找不到 -lqscintilla2

出现上述错误,在/usr/lib/x86_64-linux-gnu/目录中查找发现有libqscintilla2_qt4.so,却没有libqscintilla2.so,所以建立libqscintilla2.so的软连接。


$ sudo ln -s ../local/lib/libkscope_core.so.1 ./libkscope_core.so.1


2.2 重新编译安装kscope

$make 


/usr/bin/ld: release/editorcontainer.o: undefined reference to symbol '_ZNK13QsciScintilla17getCursorPositionEPiS0_'
//usr/lib/x86_64-linux-gnu/libqscintilla2_qt4.so.13: error adding symbols: DSO missing from command line

出现上述错误,则在./app/Makefile.Release添加-lqscintilla2。

$ vim ./app/Makefile.Release

LIBS          = $(SUBLIBS)  -L/usr/lib/x86_64-linux-gnu -L../core -lkscope_core -L../cscope -lkscope_cscope  -L../editor -lkscope_editor -lQtXml -lQtGui -lQtCore -lpthread -lqscintilla2


2.3 重新编译并安装kscope

$ make

$ make isntall


3. 运行kscope

$ kscopeapp

kscopeapp: error while loading shared libraries: libkscope_cscope.so.1: cannot open shared object file: No such file or directory


使用ldd查看kscope依赖的动态库。

$ ldd ./app/kscopeapp 
linux-vdso.so.1 =>  (0x00007fffcdafc000)
libkscope_core.so.1 => not found
libkscope_cscope.so.1 => not found
libqscintilla2_qt4.so.13 => /usr/lib/x86_64-linux-gnu/libqscintilla2_qt4.so.13 (0x00007f5e8649c000)
libkscope_editor.so.1 => not found
libQtXml.so.4 => /usr/lib/x86_64-linux-gnu/libQtXml.so.4 (0x00007f5e86256000)
libQtGui.so.4 => /usr/lib/x86_64-linux-gnu/libQtGui.so.4 (0x00007f5e85561000)
libQtCore.so.4 => /usr/lib/x86_64-linux-gnu/libQtCore.so.4 (0x00007f5e8506e000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f5e84cec000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f5e84ad5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5e8470b000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f5e84402000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f5e841be000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f5e83fa1000)
libaudio.so.2 => /usr/lib/x86_64-linux-gnu/libaudio.so.2 (0x00007f5e83d88000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f5e83a76000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f5e83851000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f5e83637000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f5e8338c000)
libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f5e83139000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f5e82f31000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f5e82d16000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f5e82b06000)
libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f5e828fc000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f5e826e9000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f5e823af000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f5e821ab000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5e81fa2000)
/lib64/ld-linux-x86-64.so.2 (0x0000555726870000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f5e81d79000)
libXt.so.6 => /usr/lib/x86_64-linux-gnu/libXt.so.6 (0x00007f5e81b0f000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f5e8190b000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f5e8169b000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f5e81492000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f5e8128d000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f5e8106a000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f5e80e64000)

发现找不到一些动态库,通过查看下述安装信息发现把 kscope运行库安装到了/usr/local/lib/目录下。

cd core/ && make -f Makefile install
make[1]: Entering directory '/home/chy/Downloads/google/kscope-1.9.4/core'
make -f Makefile.Release install
make[2]: Entering directory '/home/chy/Downloads/google/kscope-1.9.4/core'
install -m 755 -p "libkscope_core.so.1.0.0" "/usr/local/lib/libkscope_core.so.1.0.0"
strip --strip-unneeded "/usr/local/lib/libkscope_core.so.1.0.0"
ln -f -s "libkscope_core.so.1.0.0" "/usr/local/lib/libkscope_core.so"
ln -f -s "libkscope_core.so.1.0.0" "/usr/local/lib/libkscope_core.so.1"
ln -f -s "libkscope_core.so.1.0.0" "/usr/local/lib/libkscope_core.so.1.0"
make[2]: Leaving directory '/home/chy/Downloads/google/kscope-1.9.4/core'
make[1]: Leaving directory '/home/chy/Downloads/google/kscope-1.9.4/core'
cd cscope/ && make -f Makefile install
make[1]: Entering directory '/home/chy/Downloads/google/kscope-1.9.4/cscope'
make -f Makefile.Release install
make[2]: Entering directory '/home/chy/Downloads/google/kscope-1.9.4/cscope'
install -m 755 -p "libkscope_cscope.so.1.0.0" "/usr/local/lib/libkscope_cscope.so.1.0.0"
strip --strip-unneeded "/usr/local/lib/libkscope_cscope.so.1.0.0"
ln -f -s "libkscope_cscope.so.1.0.0" "/usr/local/lib/libkscope_cscope.so"
ln -f -s "libkscope_cscope.so.1.0.0" "/usr/local/lib/libkscope_cscope.so.1"
ln -f -s "libkscope_cscope.so.1.0.0" "/usr/local/lib/libkscope_cscope.so.1.0"
make[2]: Leaving directory '/home/chy/Downloads/google/kscope-1.9.4/cscope'
make[1]: Leaving directory '/home/chy/Downloads/google/kscope-1.9.4/cscope'
cd editor/ && make -f Makefile install
make[1]: Entering directory '/home/chy/Downloads/google/kscope-1.9.4/editor'
make -f Makefile.Release install
make[2]: Entering directory '/home/chy/Downloads/google/kscope-1.9.4/editor'
install -m 755 -p "libkscope_editor.so.1.0.0" "/usr/local/lib/libkscope_editor.so.1.0.0"
strip --strip-unneeded "/usr/local/lib/libkscope_editor.so.1.0.0"
ln -f -s "libkscope_editor.so.1.0.0" "/usr/local/lib/libkscope_editor.so"
ln -f -s "libkscope_editor.so.1.0.0" "/usr/local/lib/libkscope_editor.so.1"
ln -f -s "libkscope_editor.so.1.0.0" "/usr/local/lib/libkscope_editor.so.1.0"
make[2]: Leaving directory '/home/chy/Downloads/google/kscope-1.9.4/editor'
make[1]: Leaving directory '/home/chy/Downloads/google/kscope-1.9.4/editor'
cd app/ && make -f Makefile install
make[1]: Entering directory '/home/chy/Downloads/google/kscope-1.9.4/app'
make -f Makefile.Release install
make[2]: Entering directory '/home/chy/Downloads/google/kscope-1.9.4/app'
install -m 755 -p "kscopeapp" "/usr/local/bin/kscopeapp"
strip "/usr/local/bin/kscopeapp"
make[2]: Leaving directory '/home/chy/Downloads/google/kscope-1.9.4/app'
make[1]: Leaving directory '/home/chy/Downloads/google/kscope-1.9.4/app'


上述问题有两个解决办法:

① 修改/etc/ld.so.conf ,把/usr/local/lib追加到最后面,并执行ldconfig

# vim /etc/ld.so.conf

include /etc/ld.so.conf.d/*.conf

/usr/local/lib/

# ldconfig

② 在/usr/lib建立所需动态库的软连接

$ sudo ln -s ../local/lib/libkscope_core.so.1 ./libkscope_core.so.1

$ sudo ln -s ../local/lib/libkscope_editor.so.1 ./libkscope_editor.so.1

$ sudo ln -s ../local/lib/libkscope_cscope.so.1 ./libkscope_cscope.so.1


4. 运行kscopeapp

kscopeapp



  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值