【发布时间】:2018-03-19 20:45:35
【问题描述】:
如何在windows下以可重复的批处理模式编译一个自建的Apache模块(不使用我必须先编译的工具编译的工具)?
我有:
- 赢得 10 / 德语
- visual studio build tools 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编译的
- 试图运行:
[我的路径]\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。但是为什么其他论坛的那个人会这样写呢?我错过了什么?
【问题讨论】:
-
注意:apachelounge 链接用于构建 apache 2.4 版本,而您说您正在构建 apache 2.24(我认为您的意思是 2.2.24)...不同的版本可能有不同的构建说明。
-
谢谢你,TonyB - 点了;我仍然想知道该错误是否不表示(另一个)更重要的问题;与此同时,我还发现了其他类似的 g++ 和 gcc 编译语句(它们针对 2.4 之前的 apache 版本,并且表明相同或相似的编译模式也可以在那里工作)。我正在与 cygwin 并行安装 - 让我们看看,这是怎么回事
标签: c apache-modules