<button id="mgqzr"></button>
<noscript id="mgqzr"></noscript>
<button id="mgqzr"></button>
<pre id="mgqzr"><sup id="mgqzr"><sub id="mgqzr"></sub></sup></pre>
<noscript id="mgqzr"><b id="mgqzr"></b></noscript><button id="mgqzr"></button>

<noscript id="mgqzr"></noscript><button id="mgqzr"><b id="mgqzr"><th id="mgqzr"></th></b></button>
<pre id="mgqzr"><b id="mgqzr"></b></pre><button id="mgqzr"><menuitem id="mgqzr"><table id="mgqzr"></table></menuitem></button>
<pre id="mgqzr"><input id="mgqzr"></input></pre>

cmake無法找到openssl [英] cmake not able to find openssl

查看:24026
本文介紹了cmake無法找到openssl的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我試圖安裝一個軟件,它使用cmake安裝本身,當我給在commandlin cmake。

它給我以下錯誤在這個文件,CMakeLists.txt ----- ---
line ---> find_package(OpenSSL REQUIRED): -

I am trying to install a software, which uses cmake to install itself, when i give at commandlin cmake ..
it gives me following error in this file, CMakeLists.txt -------- line ---> find_package(OpenSSL REQUIRED) :--

 cmake ..
-- Could NOT find Git (missing:  GIT_EXECUTABLE) 
ZLib include dirs: /usr/include
ZLib libraries: /usr/lib/arm-linux-gnueabihf/libz.so
Compiling with SSL support
CMake Error at /usr/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES
  OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-2.8/Modules/FindOpenSSL.cmake:313 (find_package_handle_standard_args)
  CMakeLists.txt:436 (find_package)

這是文件CMakeLists.txt的一部分,其中錯誤是:------

Here is the part of file CMakeLists.txt, where error is comming :------

#
# OpenSSL
#
if (WITH_SSL)
    message("Compiling with SSL support")

    if (USE_CYASSL)
        # Use CyaSSL as OpenSSL replacement.
        # TODO: Add a find_package command for this also.
        message("CyaSSL include dir: ${CYASSL_INCLUDE_DIRS}")
        message("CyaSSL libraries: ${CYASSL_LIB}")

        # Additional to the root directory we need to include
        # the cyassl/ subdirectory which contains the OpenSSL
        # compatability layer headers.
        foreach(inc ${CYASSL_INCLUDE_DIRS})
            include_directories(${inc} ${inc}/cyassl)
        endforeach()

        list(APPEND LIB_LIST ${CYASSL_LIB})
    else()
        # TODO: Add support for STATIC also.
        find_package(OpenSSL REQUIRED)

        message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
        message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")

        include_directories(${OPENSSL_INCLUDE_DIR})
        list(APPEND LIB_LIST ${OPENSSL_LIBRARIES})
    endif()
endif(WITH_SSL)

http://www.opensource.apple.com/source/OpenSSL/OpenSSL-7.1/openssl/INSTALL?txt

現在我已安裝Openssl,其中:----



http://www.opensource.apple.com/source/OpenSSL/OpenSSL-7.1/openssl/INSTALL?txt
Now i have installed Openssl, here :----

ssl header is here   -- > /usr/local/ssl/include/openssl/
ssl library is here  -- > /usr/local/ssl/lib/libssl.a
                          /usr/local/ssl/lib/libcrypto.a
openssl is here      -- > /usr/local/ssl/bin

我將.profile設置為:----

I have set my .profile as :----

export LD_LIBRARY_PATH=/usr/local/ssl/include/openssl:/usr/lib:/usr/local/lib:/usr/lib/pkgconfig:/usr/local/include/wx-2.8/wx:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
export OPENSSL_ROOT_DIR=/usr/local/ssl
export OPENSSL_LIBRARIES=/usr/local/ssl/lib/

PATH = /usr/local/ssl/bin:$PATH

如何解決此錯誤?

編輯: -

獲取此錯誤



edit :--
Getting this error

/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x10): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x30): undefined reference to `dlclose'


推薦答案

誤解:CMake不需要環境變量來知道庫和包含dir的位置是否是CMake變量。

It is a common misunderstanding: CMake does not need environment variables to know where the library and include dir are but CMake variables.

由于CMake找不到您的OpenSSL庫和include目錄,當你打電話時,必須手動告訴他他們在它的命令行。使用選項 -D 在命令行中設置CMake中的常量。您將需要設置常量 OPENSSL_ROOT_DIR OPENSSL_LIBRARIES ,因為它們是觸發錯誤的常量。

Since CMake can not find your OpenSSL lib and include directory, you will have to manually tell him where they are with its command line when you call it. Use the option -D to set constants in CMake from the command line. You will need to set the constants OPENSSL_ROOT_DIR and OPENSSL_LIBRARIES since they are the one triggering the error.

cmake -DOPENSSL_ROOT_DIR=/usr/local/ssl -DOPENSSL_LIBRARIES=/usr/local/ssl/lib

這篇關于cmake無法找到openssl的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持IT屋!

查看全文
登錄 關閉
掃碼關注1秒登錄
發送“驗證碼”獲取 | 15天全站免登陸
亚洲AV无码国产精品
<button id="mgqzr"></button>
<noscript id="mgqzr"></noscript>
<button id="mgqzr"></button>
<pre id="mgqzr"><sup id="mgqzr"><sub id="mgqzr"></sub></sup></pre>
<noscript id="mgqzr"><b id="mgqzr"></b></noscript><button id="mgqzr"></button>

<noscript id="mgqzr"></noscript><button id="mgqzr"><b id="mgqzr"><th id="mgqzr"></th></b></button>
<pre id="mgqzr"><b id="mgqzr"></b></pre><button id="mgqzr"><menuitem id="mgqzr"><table id="mgqzr"></table></menuitem></button>
<pre id="mgqzr"><input id="mgqzr"></input></pre>