Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Unable to build mongoose_simplest_web_server

clgclg
edited January 21 in Mongoose OS

I am unable to build the Mongoose simplest_web_server_ssl (https://github.com/cesanta/mongoose/tree/master/examples/simplest_web_server_ssl). The main problem seems to be that the library called openssl.lib does not seem to have the required functions/symbols in it. I am using Mongoose 6.13, and the non-light version of OpenSSL from Shining Light Productions Win64 1.1.1a (after also loading 1.0.2q), and Visual Studio 20010 Professional on a Windows 10 (also 7) PC with 64 bit OS. I used the Visual Studio project configuration set to x64 (64 bit). The makefile from simplest_web_server indicates the openssl lib to us is openssl (SSL_LIB ?= openssl), so I used OpenSSL-Win64\lib\openssl.lib. I get 33 linker errors like:

1>mongoose.obj : error LNK2001: unresolved external symbol SSL_CTX_ctrl
1>mongoose.obj : error LNK2001: unresolved external symbol SSL_get_fd
1>mongoose.obj : error LNK2001: unresolved external symbol SSL_get_SSL_CTX
1>mongoose.obj : error LNK2001: unresolved external symbol PEM_read_bio_DHparams
1>mongoose.obj : error LNK2001: unresolved external symbol SSL_accept
1>mongoose.obj : error LNK2001: unresolved external symbol DH_free
1>mongoose.obj : error LNK2001: unresolved external symbol BIO_free
1>mongoose.obj : error LNK2001: unresolved external symbol TLS_server_method
1>mongoose.obj : error LNK2001: unresolved external symbol SSL_get_error

If I use the Win32 project configuration I get similar linker errors but the underscore prefix is present:

1>mongoose.obj : error LNK2001: unresolved external symbol _SSL_CTX_ctrl
1>mongoose.obj : error LNK2001: unresolved external symbol _SSL_get_fd
1>mongoose.obj : error LNK2001: unresolved external symbol _SSL_get_SSL_CTX
1>mongoose.obj : error LNK2001: unresolved external symbol _PEM_read_bio_DHparams
1>mongoose.obj : error LNK2001: unresolved external symbol _SSL_accept
1>mongoose.obj : error LNK2001: unresolved external symbol _DH_free
1>mongoose.obj : error LNK2001: unresolved external symbol _BIO_free
1>mongoose.obj : error LNK2001: unresolved external symbol _TLS_server_method
1>mongoose.obj : error LNK2001: unresolved external symbol _SSL_get_error

Is there a different library I should use other than openssl.lib? I do see some comments that suggest that I may have to actually build OpenSSL from scratch rather than using the Shining Light Productions installation version. I’m hoping that’s not the case as the Shining Light installation is so simple.

Aside: Shining Light Productions OpenSSL is at https://slproweb.com/products/Win32OpenSSL.html.

I find some of the unresolved symbols in other libraries so I’ve tried using other libs like libssl64MD.lib and ssleay32MD.lib and the above linker errors go away but I get 421 other linker errors like:

1>mongoose.obj : error LNK2001: unresolved external symbol PEM_read_bio_DHparams
1>libssl64MD.lib(ssl_conf.obj) : error LNK2001: unresolved external symbol PEM_read_bio_DHparams
1>libssl64MD.lib(ssl_conf.obj) : error LNK2001: unresolved external symbol DH_free
1>mongoose.obj : error LNK2001: unresolved external symbol DH_free
1>libssl64MD.lib(t1_lib.obj) : error LNK2001: unresolved external symbol DH_free

1>libssl64MD.lib(statem_srvr.obj) : error LNK2001: unresolved external symbol OPENSSL_sk_pop_free
1>libssl64MD.lib(s3_lib.obj) : error LNK2001: unresolved external symbol OPENSSL_sk_pop_free
1>libssl64MD.lib(ssl_lib.obj) : error LNK2001: unresolved external symbol OPENSSL_sk_pop_free

Thanks for any help you can provide.

Sign In or Register to comment.