logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Compile session mod on Apache 2.4.43 dllimport not allowed
Author
Apache_clan



Joined: 30 Apr 2020
Posts: 2
Location: USA,Bay Area

PostPosted: Thu 30 Apr '20 19:30    Post subject: Compile session mod on Apache 2.4.43 dllimport not allowed Reply with quote

Build info: windows 64, visual studio 2019 developer tool. Cmake, nmake

I was able to compile about 20 modules as part of libhttpd.dll by tweaking the original CMakeLists.txt
and modules.c, but I am not successful on compiling session module.

In CMakeList.txt:
SET(LIBHTTPD_SOURCES
${extra_builtin_modules}
${PROJECT_BINARY_DIR}/modules.c
modules/session/mod_session.c

In modules.c
extern module session_module;
and included to 3 declaration functions.


My cmake:
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=./Release/x64 -DCMAKE_BUILD_TYPE=Release -DINSTALL_MANUAL=OFF -DINSTALL_PDB=OFF -DINSTALL_MANUAL=OFF -DEXTRA_INCLUDES=C:/OpenSSL-Win64/include ../src/httpd-2.4.43

nmake error:
E:\Dev\src\httpd-2.4.43\modules\session\mod_session.c(44): error C2491: 'ap_hook_session_load': definition of dllimport function not allowed
E:\Dev\src\httpd-2.4.43\modules\session\mod_session.c(44): error C2491: 'ap_hook_get_session_load': definition of dllimport function not allowed

Checking mod_session.c that error refers to this code:
APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, SESSION, int, session_load,
(request_rec * r, session_rec ** z), (r, z), DECLINED);
APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap, SESSION, int, session_save,
(request_rec * r, session_rec * z), (r, z), DECLINED);
APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ap, SESSION, int, session_encode,
(request_rec * r, session_rec * z), (r, z), OK, DECLINED);
APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ap, SESSION, int, session_decode,
(request_rec * r, session_rec * z), (r, z), OK, DECLINED);

I am not sure how to fix this error. I am researching about dllimport and dllexport but I have no idea how to fix this.

I am not an expert in programming or compiling. I hope someone can shine some light on this error.
Back to top
Apache_clan



Joined: 30 Apr 2020
Posts: 2
Location: USA,Bay Area

PostPosted: Sat 02 May '20 21:58    Post subject: Its fixed now. Due to Makefile issue with dllexport Reply with quote

The makefile is such a pain to work with, causing so many errors, like parsing includes and switching between dllexport and dllimport.

See my final build.
httpd.exe -t -D DUMP_MODULES
Loaded Modules:
core_module (static)
win32_module (static)
mpm_winnt_module (static)
http_module (static)
so_module (static)
alias_module (static)
env_module (static)
headers_module (static)
setenvif_module (static)
version_module (static)
buffer_module (static)
mime_module (static)
dir_module (static)
access_compat_module (static)
autoindex_module (static)
authn_core_module (static)
auth_digest_module (static)
auth_basic_module (static)
authn_file_module (static)
authz_core_module (static)
authz_host_module (static)
authz_user_module (static)
log_config_module (static)
session_module (static)
session_crypto_module (static)
cache_module (static)
cache_socache_module (static)
socache_shmcb_module (static)
ssl_module (static)


27,648 httpd.exe
3,317,760 libhttpd.dll
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sat 02 May '20 23:43    Post subject: Reply with quote

Please post your working cmake file.

Why all modules static and not shared?
Back to top


Reply to topic   Topic: Compile session mod on Apache 2.4.43 dllimport not allowed View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads