2013-12-19 123 views
0

我遇到了使用Cmake構建FLANN庫的問題。我使用的編譯器是VS 2005編譯器。Cmake:構建FLANN庫

我在建築過程中遇到了一些錯誤,如下所示。提前致謝。 的FLANN源可以從here


The C compiler identification is MSVC 14.0.50727 
The CXX compiler identification is MSVC 14.0.50727 
Check for working C compiler using: Visual Studio 8 2005 
Check for working C compiler using: Visual Studio 8 2005 -- works 
Detecting C compiler ABI info 
Detecting C compiler ABI info - done 
Check for working CXX compiler using: Visual Studio 8 2005 
Check for working CXX compiler using: Visual Studio 8 2005 -- works 
Detecting CXX compiler ABI info 
Detecting CXX compiler ABI info - done 

CMake的警告(DEV)在的CMakeLists.txt下載:3(add_definitions): 政策CMP0005未設置:預處理器定義值現在逃出 自動。運行「cmake --help-policy CMP0005」獲取策略詳細信息。使用 cmake_policy命令設置策略並取消此警告。 此警告適用於項目開發人員。使用-Wno-dev來抑制它。

CMake Error at CMakeLists.txt:115 (install): 
    install TARGETS given no ARCHIVE DESTINATION for static library target 
    "flann_cpp_s". 


CMake Warning (dev) in CMakeLists.txt: 
    No cmake_minimum_required command is present. A line of code such as 

    cmake_minimum_required(VERSION 2.8) 

    should be added at the top of the file. The version specified may be lower 
    if you wish to support older CMake versions for this project. For more 
    information run "cmake --help-policy CMP0000". 
This warning is for project developers. Use -Wno-dev to suppress it. 
Configuring incomplete, errors occurred! 
See also "C:/FlannLib/CMakeFiles/CMakeOutput.log". 
+0

如果你不打算運行'make install',你可以刪除該行(它調用'install(TARGETS ...)'),它仍然會編譯 – szx

+0

我現在有另一個問題。我的程序必須使用** flann :: Matrix m **,我不知道如何將Cmake製作的文件整合到我的項目中。在編譯由Cmake創建的項目後,我得到了一個名爲flann_cpp.obj的文件。 – user3217504

回答

1

對於任何未來的讀者,這個錯誤可能是由於提供CMake的與錯誤的目錄中的源代碼。

源代碼目錄必須是根目錄(包含bin,src,examples等),而不是src子目錄。