Install Kscope on Ubuntu9.04

Source: Internet
Author: User
Kscope is my favorite tool for viewing code on Linux, because I am not familiar with Emacs, vim + ctags, and can still look at small programs. It is dumb to look at large projects. I have tried Source-Navigator before (this project has not been updated for N years. I couldn't install it in 06 years, and it was revived at the end of 08 years. I will try again when I have time), Eclipse, Kdevelop, CodeBlocks, in short, there is no Kscope with the most comfortable. Ksco

Kscope is my favorite tool for viewing code on Linux, because I am not familiar with Emacs, vim + ctags, and can still look at small programs. It is dumb to look at large projects. I have tried Source-Navigator before (this project has not been updated for N years. I couldn't install it in 06 years, and it was revived at the end of 08 years. I will try again when I have time), Eclipse, Kdevelop, CodeBlocks, in short, there is no Kscope with the most comfortable. Kscope gives me the following features:

1. It is called the source-editing environment, rather than the IDE.I don't have to worry about selecting the project type, compiler, and compilation options when creating a Kscope project. Compile Makefile. I just need to find a tool to check the code. Is it so troublesome to use it. When creating a Kscope project, you only need to do two things: select the project name, Project SAVE address, and add the source file.

2. It will not create a pile of messy files in the source file directory, affecting the city appearance.I remember that Eclipse, CodeBlocks, and so on will save the project information under the source file directory, and the Kscope project storage location can be selected by myself, for example, I usually save it under the workspace/kscope directory, this will not affect the source file directory to be viewed. Therefore, the project of Kscope has nothing to do with the source file. I can add the source files from any location to a project.

3. It does not read non-specified types of files.This is for Eclipse. Every time you search for an Eclipse project. the results of files in the svn directory made me very worried. I didn't know if Eclipse is more intelligent for two years, but what Eclipse cannot do is to slow down and eat memory.

4. It supports the basic functions of code viewing.In fact, I usually use the following features: syntax highlighting, opening multiple files at the same time, searching strings in the entire project, searching for Function Definition locations and references, project file list + search. In these cases, it is said that SourceInsight in Windows is doing better, but I have never used it to have a say.

In short, the comparison between Kscope and other tools isFast, simple, and worry-free. However, the times are changing. in the twinkling of an eye, the era of KDE4 is still in KDE3.5. In the dependency of Ubuntu 9.04, Kscope has been removed. On sudo apt-get install kscope on 9.04, the following message is displayed: E: Couldn't find package kscope, it's really frustrating.

In fact, the main reason why Kscope cannot be installed is that it depends on two libraries of Kate: libkateinterfaces. so.0 and libkateinterfaces. so.0. After the two libraries are extracted from Kate of KDE3.5 and installed in the system, Kscope can run normally. Although Kscope cannot be found in the dependency of Ubuntu 9.04, there is a Kscope package in the Ubuntu software repository. We can manually download and install it. The function of the script below is to automatically install kscope to Ubuntu 9.04. A slight modification can also be used to install Kscope in other KDE4 desktop systems, or solve the problem that Kscope cannot run. You can also download the script from here:

#! /Bin/bash
# This script helps you install Kscope on Ubuntu 9.04.
# You can also use it to fix "Kscope doesn't run in KDE4" bug.

Echo"Determining machine hardware name ..."
MACHINE =`Uname-m`
Case "$ MACHINE"In
I386 | i586 | i686)
ARCH ="I386"
;;
X86_64)
ARCH ="Amd64"
;;
*)
ARCH ="I386"
;;
Esac

# If Kscope is not installed, install it.
Which kscope &>/dev/null
If[$? -Ne 0];Then
Echo"Installing kscope ..."
Sudo apt-get install kscope |\
Wget http://archive.ubuntu.com/ubuntu/pool/universe/k/kscope/kscope_1.6.0-1 _$ {ARCH}. Deb &&\
Sudo dpkg-I kscope _ *. deb |\
Sudo apt-get-fy install |\
Echo"Oops, some error happens ..."
Fi

Kscope-v &>/dev/null
If[$? -Eq 0];Then
Echo"Kscope works fine ."
Exit
Fi

Echo"Downloading KDE3 libraries needed by kscope ..."
Wget http://ftp.debian.org/debian/pool/main/k/kdebase/kate_3.5.9.dfsg.1-6 _$ {ARCH}. Deb
Dpkg-x kate_3 *. deb kate

Echo"Installing KDE3 libraries ..."
Sudo cp kate/usr/lib/libkateinterfaces. so.0.0.0/usr/local/lib/
Sudo cp kate/usr/lib/libkateutils. so.0.0.0/usr/local/lib
Sudo ln-s/usr/local/lib/libkateinterfaces. so.0.0.0/usr/local/lib/libkateinterfaces. so.0
Sudo ln-s/usr/local/lib/libkateutils. so.0.0.0/usr/local/lib/libkateutils. so.0
Sudo ldconfig

Echo"Finished ." 

 

 

This article from http://blog.solrex.cn/articles/install-kscope-on-ubuntu-9-04.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.