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?
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:
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.
Adding the /D SSL_DECLARE_EXPORT to the makefile worked.
Much appreciated.