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: How to compile self created Apache module under windows?
Author
quicker



Joined: 21 Mar 2018
Posts: 2

PostPosted: Thu 22 Mar '18 19:43    Post subject: How to compile self created Apache module under windows? Reply with quote

How to compile a self created Apache module under windows in repeatable batch mode (without using a tool that I have to compile with a tool that I have to compile first)?

I have got:
- win 10 / german
- visual studio build tools 2017
- apache 2.4 (httpd-2.4.23-win64-VC14)
- a demo apache module code 'mod_example_1.c' from here: https://httpd.apache.org/docs/2.4/developer/modguide.html

here is what I did:
- tried to recompile aspx with cygwin-perl -> got stuck in perl error messages
- read somewhere, that windows apache is compiled via visual studio
- did run in cmd:
[mypath]\cl -nologo -MD -W3 -O2 -c -DWIN32 -D_WINDOWS -DNDEBUG -I[includepath1] -I[includepath2]-I[includepath3] -I[includepath4] -I[includepath5] mod_example_1.c
from within the folder where I put mod_example_1.c, according to post 2 under
https://www.apachelounge.com/viewtopic.php?t=5611
(of cause bracket-strings [ ] are placeholders for real pathes or pathes+files on my computer)

This returned me german error messages:
mod_example_1.c(13): error C2054: Nach "module" muss "(" folgen
mod_example_1.c(13): error C2085: "example_module": Nicht in der formalen Parameterliste enthalten
mod_example_1.c(13): error C2143: Syntaxfehler: Es fehlt ";" vor "="
mod_example_1.c(30): warning C4013: "ap_hook_handler" undefiniert; Annahme: extern mit Rückgabetyp int

meaning:
mod_example_1.c(13): error C2054: After "module" must follow "("
mod_example_1.c(13): error C2085: "example_module": Not part of the formal list of parameters
mod_example_1.c(13): error C2143: Syntax error: ";" is missing, before "="
mod_example_1.c(30): warning C4013: "ap_hook_handler" undefined; assumption: external with return type int

What do I miss? ...and also where is 'module' defined as I could not find it in the list of c-reserved words and according to my windows search not in any h-file in my apache-include-folder?

If I did post to the wrong forum category please let me know - I am really not sure if I got that right.

Mod edit: changed the english translation for the error messages
Back to top
James Blond
Moderator


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

PostPosted: Fri 23 Mar '18 15:04    Post subject: Reply with quote

That module is no complete. For a very simple testing module in a single file see https://github.com/JBlond/mod_moo/blob/master/src/mod_moo2.c

The last paramter in module AP_MODULE_DECLARE_DATA ( the hook function) has to be a valid function. That hook also triggers the init function

if you still have a question please ask again.
Back to top
quicker



Joined: 21 Mar 2018
Posts: 2

PostPosted: Fri 23 Mar '18 23:08    Post subject: Reply with quote

works like a charm - thank you very much

...I was so convinced that this demo module is complete... hours over hours search at the wrong place... really: thank you...
Back to top


Reply to topic   Topic: How to compile self created Apache module under windows? View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads