1

My Objective:

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

The Warnings and Errors:

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

Software:

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

What I've tried:

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 or OpenSSL-Win32/lib/openssl.lib
  • OPENSSL_CONF = bin\openssl.cfg
  • OPENSSL_INCLUDE_DIR = OpenSSL-Win32/include/openssl

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).

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?

Community
  • 1
  • 1
Jnr
  • 1,504
  • 2
  • 21
  • 36
  • Do ***not*** use CMake for OpenSSL. It cannot handle the library. The library will not be configured and you will be missing critical defines. CMake can't seem to get the `CFLAGS` right for stock flags. There is no way its going to get it right for OpenSSL. Instead, follow ***`NOTES.WIN`*** from the root OpenSSL directory. – jww Sep 26 '16 at 08:26
  • Related, this is what goes into fat libraries on OS X: [Build Multiarch OpenSSL on OS X](http://stackoverflow.com/q/25530429). I realize OS X is not Windows and CMake, but it goes into some details about the problems you are going to have. You have to get your filelist right, and even the assembler flags right. You also have got to get all the stuff right that gets put into both `` and ``. – jww Sep 26 '16 at 08:32

2 Answers2

0

I've previously had the same problem.

Try changing OPENSSL_LIBRARIES path to OpenSSL-Win32/lib/vc.

macserv
  • 3,546
  • 1
  • 26
  • 36
0

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

OPENSSL_ROOT_DIR = C:/OpenSSL-Win32

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

Debby Mendez
  • 691
  • 10
  • 16