找不到Cmake编译器错误ANN库

时间:2019-09-23 08:36:53

标签: cmake

我尝试编译此存储库link,但是我陷入了CMake错误:找不到 ann_LIBRARIES 。在内部网中搜索时,我发现了我构建的ANN link,但我不知道如何在Cmake文件中给出绝对路径。而且我还安装了libflann1.9和libflann-dev,但仍然遇到相同的问题。

我有ubuntu 18.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".

谢谢

1 个答案:

答案 0 :(得分:0)

最后,我能够编译代码库

我的程序如下:

  1. 首先,我尝试在ubuntu 18.04中编译源代码,但遇到了很多错误,因此我在ubuntu 14.04(码头工人)中进行了尝试。
  2. 我安装了作者提到的必需软件包。
  3. 现在我遇到了an_LIBRARIES问题,为此,我从link下载了ANN库,并只需从an_1.1.2文件夹内执行 make linux-g ++ 进行构建
  4. 现在可以使用ANN库了。之后,为避免在构建过程中出现an_LIBRARIES问题,我们应该从终端cmake -Dann_LIBRARIES=/home/ann_1.1.2/lib/libANN.a ..执行命令
  5. 到目前为止,我已经成功构建了项目。现在是时候使用make命令来编译代码了,我又遇到了ANN/ANN.h: No such file or directory错误,我通过提供每个发生错误的文件的绝对路径#include </home/ann_1.1.2/include/ANN/ANN.h> //approximate) nearest neighbor来解决了这个错误。显然提供绝对路径不是一个好主意。就这样

感谢@Tsyvarev

希望这对某人有帮助。

相关问题