The Apache Haus Forum

Forum Topics => Apache Programming and Building => Topic started by: swanman on May 08, 2017, 06:48:52 PM

Title: Compile errors building mod_ssl
Post by: swanman on May 08, 2017, 06:48:52 PM
Compile 2.4.25, openssl 1.02k, but get compile errors when building mod_ssl

mod_ssl.c
mod_ssl.c(38) : error C2491: 'ssl_run_pre_handshake' : definition of dllimport function not allowed

Any idea how to fix this?
Title: Re: Compile errors building mod_ssl
Post by: Gregg on May 08, 2017, 11:04:51 PM
On Windows, everything defaults to __declspec(dllimport) unless told otherwise. In all the ways to build Apache on MSVC that are currently available it's handled by the makefiles. So I have to ask how are your trying to build this?

However regardless of how your building it, -DSSL_DECLARE_EXPORT must be in the CFLAGS.

Then again, Line 36-38 is:
Code: [Select]
APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ssl, SSL, int, pre_handshake,
                                    (conn_rec *c,SSL *ssl,int is_proxy),
                                    (c,ssl,is_proxy), OK, DECLINED);

This however is controlled by APR or APR-Util I cannot remember which. You may need these in your cflags as well but they should have been obtained from apr.h and apu.h via httpd.h which is called in mod_ssl.h
.
-DAPR_DECLARE_EXPORT or -DAPU_DECLARE_EXPORT.

 
Title: Re: Compile errors building mod_ssl
Post by: swanman on May 09, 2017, 09:58:13 PM

Adding the /D SSL_DECLARE_EXPORT to the makefile worked.

Much appreciated.