我可以在 Visual Studio 2010 年使用 C 构建自定义 Apache 模块扩展吗?

Can I build a custom Apache Module Extension using C in Visual Studio 2010?

我只是想为我的项目创建一个自定义的 Apache 模块扩展。我在 Windows Vista 32 位版本上使用 VS2010 终极版。我从 Win32 DLL 项目开始并将主文件的扩展名重命名为 .c.

项目配置如下:

TargetExtension: .so
RuntimeLibrary: /MD
CallingConvention: /Gd
CompileAs: /TC

当我运行编译[Ctrl+F7]时,它产生了一些错误,它们是:C2065, C2167, C2223, C2275等。我将文件扩展名改回.cpp并将其编译为/TP 编译成功。但是,我没有将所需的模块名称作为 infovalley_module(我想创建),而是将其作为 ?infovalley_module@@3Umodule_struct@@A.

首先我想知道为什么?infovalley_module@@3Umodule_struct@@A?仅仅因为我正在使用 __cdecl?

其次,我想知道我不能使用 .c 扩展在 VS2010 中编译和构建 .dll.so 文件吗?

最后 - 我想得到启发,不像 ?infovalley_module@@3Umodule_struct@@A 不能在 VS2010 中创建自定义模块有一个像 auth_basic_modulessl_module 那样的专有名称?

提前谢谢大家的期待,对不起我的英语术语。

此致,

* 编辑 *

调用apxs -c -i mod_infovalley.c命令不仅解决了这个问题,而且带来了 另一个灯故障。当我发出命令 httpd -t 时,它抛出了:

API module structure `infovalley_module' in file path/to/apache/modules/mod_infovalley.so is garbled - perhaps this is not an Apache module DSO?

* 问题 *

  1. 有什么解决办法可以解决这个问题?
  2. 我可以使用 Windows Vista 32 位系统中的 apxs 创建自定义 Apache 模块吗?

此致,

下载 Win32 模块的 apxs 工具并在配置部分进行一些更改为我解决了这个问题。我现在可以使用我为模块提供的名称为我的项目自由构建自定义 Apache 模块。