Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
未找到Cmake编译器错误ANN库_Cmake - Fatal编程技术网

未找到Cmake编译器错误ANN库

未找到Cmake编译器错误ANN库,cmake,Cmake,我试图编译此存储库,但遇到了一个CMake错误:ann\u库未找到。在inernet中搜索时,我找到了我构建的ANN,但我不知道如何在Cmake文件中给出绝对路径。我还安装了libflann1.9和libflann dev,但仍然存在同样的问题 我安装了Ubuntu18.04和qt5、boost-lib、blas&lapack和libpng库 cmake .. -- The C compiler identification is GNU 7.4.0 -- The CXX compiler id

我试图编译此存储库,但遇到了一个CMake错误:ann\u库未找到。在inernet中搜索时,我找到了我构建的ANN,但我不知道如何在Cmake文件中给出绝对路径。我还安装了libflann1.9和libflann dev,但仍然存在同样的问题

我安装了Ubuntu18.04和qt5、boost-lib、blas&lapack和libpng库

cmake ..
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   serialization
--   filesystem
--   system
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for module 'libxml++-2.6'
--   Found libxml++-2.6, version 2.40.1
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   system
--   filesystem
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   thread
--   chrono
--   system
--   date_time
--   atomic
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   system
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.34") 
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   thread
--   system
--   chrono
--   date_time
--   atomic
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   thread
--   serialization
--   program_options
--   regex
--   system
--   chrono
--   date_time
--   atomic
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   regex
--   system
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   system
-- Boost version: 1.65.1
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   regex
--   system
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
ann_LIBRARIES
    linked by target "TrackingUtils" in directory /home/dhiren/Dev/FranksVelodyneAlgos/libTrackingUtils

-- Configuring incomplete, errors occurred!
See also "/home/dhiren/Dev/FranksVelodyneAlgos/build/CMakeFiles/CMakeOutput.log".
See also "/home/dhiren/Dev/FranksVelodyneAlgos/build/CMakeFiles/CMakeError.log".

谢谢

最后,我能够编译代码库了

我的程序如下:

  • 首先,我尝试在ubuntu 18.04中编译源代码,但是遇到了太多错误,所以我尝试在ubuntu 14.04(docker)中编译
  • 我安装了作者提到的必需的软件包
  • 现在我遇到了安库的问题,为此,我从下载了安库,只需在安库1.1.2文件夹中执行make linux-g++即可构建安库
  • 现在安图书馆已经可以使用了。之后,为了避免在构建过程中出现ann_库问题,我们应该从terminal
    cmake-Dann_库=/home/ann_1.1.2/lib/libANN.a..
  • 到目前为止,我成功地完成了这个项目。现在是使用
    make
    命令编译代码的时候了,我再次得到了
    ANN/ANN.h:没有这样的文件或目录
    错误,我通过从出现错误的每个文件中给出absulute path
    #include//approximate)near
    来解决。显然,提供绝对路径不是一个好主意。就这样
  • 感谢@Tsyvarev


    希望这会对某些人有所帮助。

    “我不知道如何在Cmake文件中给出绝对路径。”-向
    Cmake
    添加选项,设置给定变量
    -Dann_LIBRARIES=/path/to/lib
    @Tsyvarev哦,伙计,这个技巧正在发挥作用,但我收到警告“警告:Target“visTracks”请求链接到目录”/home/dhiren/Downloads/ann_1.1.2”。目标只能链接到库。CMake正在删除该项。“在我之前的评论中,
    path/to/lib
    是文件的绝对路径,而不是目录。它应该类似于
    /home/dhiren/Downloads/ann_1.1.2/libann.so
    。我找不到libann.so取而代之的是libann.a内部的lib文件夹您可以将
    include_目录(“/home/ann_1.1.2/include”)
    行添加到