简体   繁体   English

找不到Openssl标头-错误

[英]Openssl header not found — error

I need to compile a libwebsocket library for my ARM target which requires openssl for its functioning. 我需要为我的ARM目标编译一个libwebsocket库该库需要openssl才能运行。 I am getting following error when i build latest libwebsocket at the time of, cmake ... 我在建立最新的libwebsocket时发生以下错误,cmake ...

But openssl is installed here 但是openssl安装在这里

whereis openssl
openssl: /usr/bin/openssl /usr/bin/X11/openssl /usr/share/man/man1/openssl.1ssl.gz

=================================== Error ================ ==================================错误============== ==

-- Looking for 4 include files stdlib.h, ..., float.h - found
-- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.7") 
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)


-- Configuring incomplete, errors occurred!

======================================= openssl is here ======================== ====================================== openssl在这里======== ================

ignite@ignite:~/sbox2/rootfs/rfs-raspbian_2/home/pi/libwebsockets/build$  whereis openssl
openssl: /usr/bin/openssl /usr/bin/X11/openssl /usr/share/man/man1/openssl.1ssl.gz

actually i have, source tarball from here. 其实我有,从这里来源tarball。 it have configure script to make & make install http://www.openssl.org/source/ 它具有配置脚本以进行&进行安装http://www.openssl.org/source/
openssl-1.0.1e.tar.gz openssl-1.0.1e.tar.gz

So with this (openssl-1.0.1e.tar.gz) will be the right package to get --> openssl-dev or openssl-devel --- so that i can resolve this error ? 所以有了这个(openssl-1.0.1e.tar.gz)将是获取-> openssl-dev或openssl-devel ---的正确软件包,以便我可以解决此错误?

So with this (openssl-1.0.1e.tar.gz) will be the right package to get --> openssl-dev or openssl-devel --- so that i can resolve this error ? 所以有了这个(openssl-1.0.1e.tar.gz)将是获取-> openssl-dev或openssl-devel ---的正确软件包,以便我可以解决此错误?

The openssl-dev packages are for development on the host machine (which is probably x86 or x64 family). openssl-dev软件包用于在主机(可能是x86或x64系列)上进行开发。 You need a cross compiled library for the target (and not the host). 您需要目标(而不是主机)的交叉编译库。 So openssl-dev will probably not solve your problem. 因此, openssl-dev可能无法解决您的问题。

Are you targeting a generic ARM processor, iOS, or Android? 您是针对通用ARM处理器,iOS还是Android? If the former, you will need an arm cross-toolchain with paths set appropriately. 如果是前者,则将需要一个臂交叉工具链,并适当设置路径。 I'm not aware of a good tutorial on cross compiling the library (and I've suffered it in the past). 我不知道有关交叉编译库的好教程(过去我曾受过它)。

There are some prebuilt configurations for generic cross compiling. 有一些用于通用交叉编译的预配置。 Open Configure and config , and look at some of the triples. 打开Configureconfig ,然后看一些三元组。 (OpenSSL does not use Automake and friends). (OpenSSL不使用Automake和朋友)。

If iOS or Android, the OpenSSL wiki has some examples of cross compiling for the platforms. 如果是iOS或Android,则OpenSSL Wiki包含一些针对平台进行交叉编译的示例。 See, for example, FIPS Library and Android . 例如,请参见FIPS库和Android The setenv-android.sh script is most important because it set paths, sysroot and toolchains. setenv-android.sh脚本最重要,因为它设置了路径,sysroot和工具链。 Once paths and toolschains are set, the rest is easy. 一旦设置了路径和工具链,其余的就很容易了。

If you are targeting a generic ARM, then you could use the Android setenv-android.sh as a starting point for your generic build. 如果您针对通用ARM,则可以将Android setenv-android.sh用作通用构建的起点。 Once you complete the build, then point OPENSSL_ROOT_DIR into the install directory for ARM. 完成构建后,将OPENSSL_ROOT_DIR指向ARM的安装目录。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM