未找到Cmake编译器错误ANN库
我试图编译此存储库,但遇到了一个CMake错误:ann\u库未找到。在inernet中搜索时,我找到了我构建的ANN,但我不知道如何在Cmake文件中给出绝对路径。我还安装了libflann1.9和libflann dev,但仍然存在同样的问题 我安装了Ubuntu18.04和qt5、boost-lib、blas&lapack和libpng库未找到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 ..
-- 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".
谢谢最后,我能够编译代码库了 我的程序如下:
cmake-Dann_库=/home/ann_1.1.2/lib/libANN.a..
make
命令编译代码的时候了,我再次得到了ANN/ANN.h:没有这样的文件或目录
错误,我通过从出现错误的每个文件中给出absulute path#include//approximate)near
来解决。显然,提供绝对路径不是一个好主意。就这样希望这会对某些人有所帮助。“我不知道如何在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”)
行添加到