本文介绍了CMake FIND_LIBRARY:链接到指定的库错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经在我的计算机上安装了FFTW3库,并且可以在/ usr / lib中找到以下文件:
I have already installed the FFTW3 library on my computer and the following files could be found in /usr/lib:
libfftw3f.so.3 libfftw3l_threads.so.3
libfftw3f.so.3.3.0 libfftw3l_threads.so.3.3.0
libfftw3f_threads.so.3 libfftw3.so.3
libfftw3f_threads.so.3.3.0 libfftw3.so.3.3.0
libfftw3l.so.3 libfftw3_threads.so.3
libfftw3l.so.3.3.0 libfftw3_threads.so.3.3.0
我想安装另一个需要链接这些库的包,但是当我尝试
FIND_LIBRARY FFTW3_LIBRARIES fftw3)
和 FIND_LIBRARY(FFTW3_LIBRARIES fftw3f)
,
只是找不到库。
I want to install another package that needs to link these libraries, but when I tryFIND_LIBRARY(FFTW3_LIBRARIES fftw3)
and FIND_LIBRARY(FFTW3_LIBRARIES fftw3f)
,it just cannot find the libraries.
我如何解决这个问题?感谢!
How can I solve this? Thanks!
CMakeLists.txt中的程式码:
Code in CMakeLists.txt:
FIND_PATH(FFTW3_INCLUDE_DIR fftw3.h)
IF(FFLD_HOGPYRAMID_DOUBLE)
FIND_LIBRARY(FFTW3_LIBRARIES libfftw3.so.3)
ELSE()
FIND_LIBRARY(FFTW3_LIBRARIES libfftw3f.so.3)
ENDIF()
#IF(NOT FFTW3_INCLUDE_DIR OR NOT FFTW3_LIBRARIES)
IF(NOT FFTW3_INCLUDE_DIR OR NOT FFTW3_LIBRARIES)
MESSAGE(FATAL_ERROR "Could not find fftw3.")
ENDIF()
错误讯息:
CMake Error at CMakeLists.txt:52 (MESSAGE):
Could not find fftw3.
推荐答案
尝试 gui-cmake , http://www.cmake.org/cmake/help/runningcmake.html。
然后您可以手动选择库。
Then you can select the library needed manually.
这篇关于CMake FIND_LIBRARY:链接到指定的库错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!