如何在Windows下以可重复的批处理模式编译自己创建的Apache模块(不使用我必须先编译的工具)?
我有:
- win 10/德语
- Visual Studio 构建工具 2017(我在某处读到,apache win 是通过 Visual Studio 的 cl 编译的)
- apache 2.24 - 为 64 位编译
- 来自此处的演示 apache 模块代码“mod_example_1.c”:https://httpd.apache.org/docs/2.4/developer/modguide.html
这是我所做的:
- 尝试重新编译 aspx -> 陷入 perl 错误消息 -> 放弃了,因为学习 perl 对我来说似乎是一条无路可走的路
- 发现,windows apache是通过Visual Studio编译的
- 尝试运行:
[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
从我放置 mod_example_1.c 的路径中,根据下面的帖子 2
https://www.apachelounge.com/viewtopic.php?t=5611
(因为括号字符串 [ ] 是我计算机上真实路径或路径+文件的占位符)
这给我返回了德语错误消息:
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
含义:
mod_example_1.c(13): error C2054: "module" requires to be succeeded by "("
mod_example_1.c(13): error C2085: "example_module": Not part of the formal list of parameters
mod_example_1.c(13): error C2143: Syntaxfehler: ";" is missing, before "="
mod_example_1.c(30): warning C4013: "ap_hook_handler" undefined; assumption: external with return type int
我认为,cl 中缺少解析术语“模块”的能力表明 cl 不能用于编译 apache-webserver-modules。但是为什么其他论坛的那个人会这样写呢?我错过了什么?
最佳答案
mod_perl 提供了一个奇怪的 apxs-for-windows:
关于c - 如何在Windows下以可重复的批处理模式编译自创建的Apache模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49372101/