【问题标题】:How to compile a self created Apache module under windows in repeatable batch mode?如何在可重复批处理模式下在 windows 下编译自建的 Apache 模块?
【发布时间】:2018-03-19 20:45:35
【问题描述】:

如何在windows下以可重复的批处理模式编译一个自建的Apache模块(不使用我必须先编译的工具编译的工具)?

我有:

这就是我所做的:

  • 试图重新编译 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


【解决方案1】:

mod_perl 提供了一个奇怪的 apxs-for-windows:

http://www.apache.org/dist/perl/win32-bin/

【讨论】:

    猜你喜欢
    • 2012-03-31
    • 2017-08-10
    • 1970-01-01
    • 1970-01-01
    • 2020-02-12
    • 1970-01-01
    • 2018-05-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多