CMake错误:找不到OpenSSL [英] CMake Error: Could Not Find OpenSSL

查看:1751
本文介绍了CMake错误:找不到OpenSSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标:

我正在尝试将Mosquitto代理配置为使用websocket.

I'm trying to configure Mosquitto broker to use websockets.

警告和错误:

https://docs.google.com/document/d /1HJ75NO1wBsnNfFFszeXP4p8re7m4gTE_CMbFoSswJJs/edit?usp = sharing

软件:

  • Windows 10 x64
  • libwebsockets-master
  • Cmake 3.6.2 win32
  • OpenSSL 1.1.0a
  • Visual Studio 14 2015(带有C ++编译器)
  • Windows 10 x64
  • libwebsockets-master
  • Cmake 3.6.2 win32
  • OpenSSL 1.1.0a
  • Visual Studio 14 2015 (with C++ compiler)

我尝试过的事情:

我正在使用CMake gui,因为我对这些命令不是很熟悉.我配置源和目标,并将以下变量分别设置为路径和文件路径:

I'm using CMake gui cause I'm not really familiar with the commands. I configure the source and destination and set the following variables as paths and filepaths respectively:

  • OPENSSL_ROOT_DIR = OpenSSL-Win32
  • OPENSSL_LIBRARIES = OpenSSL-Win32/lib OpenSSL-Win32/lib/openssl.lib
  • OPENSSL_CONF = bin \ openssl.cfg
  • OPENSSL_INCLUDE_DIR = OpenSSL-Win32/include/openssl

我也尝试在libwesocket的CMkakeLists.txt文件中设置OPENSSL_LIBRARIES.我使用了多个不同版本的CMake和OpenSSL.我尝试使用VS命令行(以管理员身份)打开CMake.

I tried setting the OPENSSL_LIBRARIES in the libwesocket's CMkakeLists.txt file too. I've used multiple different versions of CMake and OpenSSL. I tried opening CMake with VS command line (as admin).

我以前使用较旧的OpenSSL构建了 .sln 文件,因此编译器没有问题.

I've previously built a .sln file with older out-dated OpenSSL so there's no issue with the compiler.

我查看了以下问题:此处此处

I've looked at the questions here, here, here and here. If it boils down to using the command line specifically to set OPENSSL_ROOT_DIR, could someone shed some light on this please?

推荐答案

在构建libwebsockets时,我也遇到了相同的错误.我在cmake-gui中添加了以下条目:

I also ran into the same error when building libwebsockets. I added the following entry in cmake-gui:

OPENSSL_ROOT_DIR = C:/OpenSSL-Win32

OPENSSL_ROOT_DIR = C:/OpenSSL-Win32

我根本没有添加其他OPENSSL变量,看来cmake能够派生这些变量.

I did not add the other OPENSSL variables at all, and it seemed like cmake was able to derive those.

这篇关于CMake错误:找不到OpenSSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆