2020-03-15 19:33:29 weixin_45633206 阅读数 9

1.提示缺少course.h文件
在这里插入图片描述
解决方法:安装ncurses即可
sudo apt-get install libncurses5-dev

2.make[1]: flex:命令未找到
在这里插入图片描述
解决方法:sudo apt-get install flex

3.make[1]: bison:命令未找到
在这里插入图片描述
解决方法:apt-get install bison

4.make[1]: *** [zconf.hash.c] Error 127
在这里插入图片描述
解决方法:sudo apt-get install gperf

2018-11-22 16:55:53 Goodbye_Youth 阅读数 629

当我们在Linux上安装相关的软件源码包时,一般会涉及到以下三个步骤,分别是 ./configuremakemake install


第一步

  • ./configure
  • 该步骤主要用来检测系统的配置、环境以及相关依赖,如果缺少相关依赖,该脚本会中止执行,软件安装失败
  • 如:它会检测是否安装了gcc (用于编译各种源代码的软件),如果未安装,该脚本会中止执行
  • 当该脚本执行完成之后,它会根据之前检查的结果,生产一个 Makefile 文件,该文件规定了用什么编译器、编译参数等信息 ,描述了文件编译的相互依赖关系

第二步

  • make
  • 该步骤主要用来编译源代码,make指令会从 Makefile 文件中读取相关指令,然后进行编译,编译完成之后会生成可执行文件

第三步

  • make install
  • 该步骤主要用来安装软件,make install命令会从 Makefile 文件中读取相关指令,然后将软件安装到指定位置
  • 默认安装位置是 /usr/local

2019-03-15 23:44:19 Robot_Starscream 阅读数 2303

1.问题描述

在使用PCL做点云拼接工程中,make后出现缺少库的错误:No rule to make target '/usr/lib/x86_64-linux-gnu/libproj.so',

错误具体如下:

make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libproj.so', needed by 'joinMap'.  Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/joinMap.dir/all' failed
make[1]: *** [CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

2.问题原因:

出现缺少库的情况,通常有两种原因:

  • 此库并未被安装。
  • 此库已安装,但并未链接到此工程。(如工程中需要库的名字是:libproj4.so。但我们实际拥有:libvtkproj4.so.5.10.1,这时需要做一个链接。)

3.解决办法:

在 /usr/lib下寻找是否有 libproj.so库,如果没有则下载;如果显示已安装,则需要将这个库链接到工程。

为了得到详细的错误原因,我们运行下面代码:

make --debug

得到如下运行结果:

GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
 File 'default_target' does not exist.
   File 'all' does not exist.
     File 'cmake_check_build_system' does not exist.
    Must remake target 'cmake_check_build_system'.
    Successfully remade target file 'cmake_check_build_system'.
  Must remake target 'all'.
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
 File 'all' does not exist.
   File 'CMakeFiles/joinMap.dir/all' does not exist.
  Must remake target 'CMakeFiles/joinMap.dir/all'.
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
 File 'CMakeFiles/joinMap.dir/depend' does not exist.
Must remake target 'CMakeFiles/joinMap.dir/depend'.
Scanning dependencies of target joinMap
Successfully remade target file 'CMakeFiles/joinMap.dir/depend'.
GNU Make 4.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Reading makefiles...
Updating goal targets....
 File 'CMakeFiles/joinMap.dir/build' does not exist.
   File 'joinMap' does not exist.
     File 'CMakeFiles/joinMap.dir/joinMap.cpp.o' does not exist.
    Must remake target 'CMakeFiles/joinMap.dir/joinMap.cpp.o'.
[ 50%] Building CXX object CMakeFiles/joinMap.dir/joinMap.cpp.o
    Successfully remade target file 'CMakeFiles/joinMap.dir/joinMap.cpp.o'.
     File '/usr/lib/x86_64-linux-gnu/libproj.so' does not exist.
    Must remake target '/usr/lib/x86_64-linux-gnu/libproj.so'.
make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libproj.so', needed by 'joinMap'.  Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/joinMap.dir/all' failed
make[1]: *** [CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

重点在于其中的这两句:

File '/usr/lib/x86_64-linux-gnu/libproj.so' does not exist.
    Must remake target '/usr/lib/x86_64-linux-gnu/libproj.so'.

现在我们已确定 libproj.so库不存在,接下来去下载它。查找我们所需库的标准形式,执行指令如下:

apt-cache search libproj*

得到:

libproc-waitstat-perl - interpret and act on wait() status values
libprocess-cpp-dev - C++11 library for handling processes - dev headers and libraries
libprocess-cpp-doc - Documentation files for libprocess-cpp-dev
libprocess-cpp3 - C++11 library for handling processes - runtime library
libprocps4 - library for accessing process information from /proc
libprocps4-dev - library for accessing process information from /proc
libproperties-cpp-dev - C++11 library providing properties/signals. - dev headers
libproperties-cpp-doc - Documentation files for libproperties-cpp-dev
libprotobuf-dev - protocol buffers C++ library (development files)
libprotobuf-lite9v5 - protocol buffers C++ library (lite version)
libprotobuf9v5 - protocol buffers C++ library
libprotoc-dev - protocol buffers compiler library (development files)
libprotoc9v5 - protocol buffers compiler library
libproxy-cil-dev - automatic proxy configuration management library (CLI devel)
libproxy-dev - automatic proxy configuration management library (devel)
libproxy0.4-cil - automatic proxy configuration management library (CLI)
libproxy1-plugin-gsettings - automatic proxy configuration management library (GSettings plugin)
libproxy1-plugin-networkmanager - automatic proxy configuration management library (Network Manager plugin)
libproxy1v5 - automatic proxy configuration management library (shared)
libprobe-perl-perl - module to obtain information about the currently running Perl interpreter
libproc-background-perl - generic interface for Unix and Win32 background process management
libproc-daemon-perl - module for running scripts as daemons
libproc-fork-perl - Perl interface to the fork() system call
libproc-invokeeditor-perl - Perl extension for starting a text editor
libproc-pid-file-perl - Perl module for managing process id files
libproc-processtable-perl - Perl library for accessing process table information
libproc-queue-perl - Perl module to limit the number of child processes
libproc-reliable-perl - Perl module to run external processes reliably
libproc-simple-perl - Perl interface to launch and control background processes
libproc-syncexec-perl - spawn processes but report exec() errors properly
libproc-terminator-perl - module to conveniently terminate processes
libproc-wait3-perl - Perl interface to the wait3() system call
libprocesscore7 - library for monitoring your system - shared library
libprocessing-core-java - Java animation and interaction library
libprocessui7 - library for monitoring your system - shared library
libproj-dev - Cartographic projection library (development files)
libproj-java - Cartographic projection library (JNI bindings)
libproj9 - Cartographic projection library
libprojectm-dev - Advanced Milkdrop-compatible music visualization library - dev
libprojectm-qt-dev - projectM Qt4 (development files)
libprojectm-qt1v5 - projectM Qt4 bindings
libprojectm2v5 - Advanced Milkdrop-compatible music visualization library
libpromises3 - libpromises library for cfengine3 binaries
libproperties-maven-plugin-java - Maven Plugin to read and write property files from mojo.codehaus.org
libproperties-maven-plugin-java-doc - Documentation for Properties Maven Plugin
libprophet-perl - distributed, peer-to-peer replicated database system
libprotobuf-c-dev - Protocol Buffers C static library and headers (protobuf-c)
libprotobuf-c1 - Protocol Buffers C shared library (protobuf-c)
libprotobuf-c1-dbg - Protocol Buffers C shared library debug symbols (protobuf-c)
libprotobuf-java - Java bindings for protocol buffers
libprotocol-osc-perl - module to implement (de)coding and processing of OSC packets
libprotozero-dev - Minimalistic protocol buffer decoder and encoder in C++
libprotozero-doc - Minimalistic protocol buffer decoder and encoder in C++ - docs
libproxool-java - Java JDBC connection pool
libproxy-tools - automatic proxy configuration management library (tools)
libproxy1-plugin-kconfig - automatic proxy configuration management library (KConfig plugin)
libproxy1-plugin-webkit - automatic proxy configuration management library (Webkit plugin)
libproxychains-dev - proxy chains -- shared library (development)
libproxychains3 - proxy chains -- shared library (runtime)
projectm-data - Advanced Milkdrop-compatible music visualization library - data
protobuf-c-compiler - Protocol Buffers C compiler (protobuf-c)
python-libproxy - automatic proxy configuration management library (python)

得知所需库包含在 libproj-dev中,运行如下指令,进行安装:

sudo apt-get install libproj-dev

我们发现,文件make成功了,但还是无法显示点云文件,因为报了第二个错误,如下:

Scanning dependencies of target joinMap
[ 50%] Building CXX object CMakeFiles/joinMap.dir/joinMap.cpp.o
[100%] Linking CXX executable joinMap
/usr/bin/ld: cannot find -lvtkproj4
collect2: error: ld returned 1 exit status
CMakeFiles/joinMap.dir/build.make:377: recipe for target 'joinMap' failed
make[2]: *** [joinMap] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/joinMap.dir/all' failed
make[1]: *** [CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

现在开始着手解决第二个错误。通过 make --debug得知,又是库的问题。所以我们首先在 /usr/lib里面使用通配符*搜索 libvtkproj*

anan@ubuntu:~$ cd /usr/lib
anan@ubuntu:/usr/lib$ ls libvtkproj*

得到如下结果:

libvtkproj4.so.5.10  libvtkproj4.so.5.10.1

       

   libvtkproj4.so.5.10(蓝色)  libvtkproj4.so.5.10.1(白色)。其中:蓝色表示链接库文件,白色表示源文件

 

从而得知系统中存在 libvtkproj4.so 文件,只是我们所运行的程序不认识此版本号(libvtkproj4.so.5.10.1)。所以只需要做一个库链接,就可以解决问题。

*系统中已存在一个链接库,可以看一下它效果:

libvtkproj4.so.5.10libvtkproj4.so.5.10.1 的链接文件。

链接库的制作方法也很简单,只需要输入如下命令:

sudo ln -s libvtkproj4.so.5.10.1 libvtkproj4.so

即可得到:

此时再回到 build中重新cmake、make一下,程序就运行成功了。

补充技巧:

usr/bin 多放置可执行文件;usr/lib 多放置库文件。

当缺少库时,我们首先去lib中检查。库文件(lib)的两种格式:.so; .a

2017-07-31 16:59:16 DJH_XING 阅读数 1146

linux系统缺少perl组建中的Data::Dumper模块

perl -data-dumper模块安装方法

1. 手动安装

tar  xzvf xx.tar.gz
cd  X.X
perl Makefile.PL(生成makefile)
make (建立模块)
make install (安装模块)

2.自动安装

安装前首先机器能连接网络,并且需要用root权限
执行以下命令

perl -MCPAN  -e  shell

初次运行直接一路回车就行,只需要在最后选择一个本机访问速度最快的CPAN镜像站点
可以通过PING 网址来确定那个镜像站点连接最快

cpan>m(列出CPAN上所有的模块的列表,然后找到Data::Dumper这个模块
cpan>install Data::Dumper 
2013-01-26 21:55:25 zhucha1029 阅读数 660

解决Ubuntu使用`make menuconfig`配置Linux内核时,出现缺少'ncurses-devel'库支持。

root@zhucha-Inspiron-N5010:/home/zhucha/uplooking/smdk6410_lzy/src/linux-2.6.28_smdk6410#make mrproper

make:/usr/local/arm/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc:命令未找到

make[2]:/usr/local/arm/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc:命令未找到

CLEAN scripts/basic

CLEAN scripts/kconfig

CLEAN include/config

CLEAN .config

root@zhucha-Inspiron-N5010:/home/zhucha/uplooking/smdk6410_lzy/src/linux-2.6.28_smdk6410#make menuconfig

HOSTCC scripts/basic/fixdep

scripts/basic/fixdep.c:在函数‘traps’:

scripts/basic/fixdep.c:377:2:警告: 提领类型双关的指针将破坏强重叠规则[-Wstrict-aliasing]

scripts/basic/fixdep.c:379:4:警告: 提领类型双关的指针将破坏强重叠规则[-Wstrict-aliasing]

HOSTCC scripts/basic/docproc

HOSTCC scripts/basic/hash

HOSTCC scripts/kconfig/conf.o

scripts/kconfig/conf.c:在函数‘conf_sym’:

scripts/kconfig/conf.c:158:6:警告: 变量‘type’被设定但未被使用[-Wunused-but-set-variable]

scripts/kconfig/conf.c:在函数‘conf_choice’:

scripts/kconfig/conf.c:230:6:警告: 变量‘type’被设定但未被使用[-Wunused-but-set-variable]

scripts/kconfig/conf.c:306:9:警告: 忽略声明有 warn_unused_result属性的‘fgets’的返回值[-Wunused-result]

scripts/kconfig/conf.c:在函数‘conf_askvalue’:

scripts/kconfig/conf.c:104:8:警告: 忽略声明有 warn_unused_result属性的‘fgets’的返回值[-Wunused-result]

HOSTCC scripts/kconfig/kxgettext.o

***Unable to find the ncurses libraries or the

***required header files.

***'make menuconfig' requires the ncurses libraries.

***

***Install ncurses (ncurses-devel) and try again.

***

make[1]:*** [scripts/kconfig/dochecklxdialog] 错误 1

make:*** [menuconfig] 错误 2




***Unable to find the ncurses libraries or the

***required header files.

***'make menuconfig' requires the ncurses libraries.

***

***Install ncurses (ncurses-devel) and try again.

*** 

1.问题状况

一般情况下使用系统自带的软件管理器apt-get就可以安装了(`sudoapt-get install ncurses-devel`),但使用后却出现下面的错误提示:

正在读取软件包列表...完成

正在分析软件包的依赖关系树

正在读取状态信息...完成

E:未发现软件包ncurses-devel 

再试了另一条命令`sudoapt-get install ncurses`, 出现:

正在读取软件包列表...完成

正在分析软件包的依赖关系树

正在读取状态信息...完成

现在没有可用的软件包ncurses,但是它被其它的软件包引用了。

这可能意味着这个缺失的软件包可能已被废弃,

或者只能在其他发布源中找到

E:软件包ncurses没有可供安装的候选者

2.解决方法

Linux几乎每个发行版都会有'ncurses''ncurses-devel'的安装包的,再根据上面第二条命令错误提示,“现在没有可用的软件包ncurses,但是它被其它的软件包引用了。”可以判定Ubuntu软件管理器服务端有作修改过。所以到 Ubuntu Packagearchivehttp://packages.ubuntu.com/)搜索是否存在该安装包,用'ncurses-devel'作为关键字搜索,没有任何结果。搜索'ncurses'出现了很多返回结果。根据每个返回搜索结果的说明可以发现在Ubuntu'ncurses-devel'是以'libncurses5-dev'命名的。

#sudo apt-get install libncurses5-dev (安装过程没有提示任何错误,安装成功)

接着再试一下`makemenuconfig`,可以正常进入内核配置了。


没有更多推荐了,返回首页