如何构建 Apache WebSocket 模块?

How to build Apache WebSocket module?

我花了很多时间来解决这个问题。我也找到了 Apache-WebSocket from Disconnect and decided to try this out. The description recommends Scons. However, to be able to use Scons, I need Python。我安装了最新的 3.x+ Python,但是当我也安装 Scons 并尝试构建模块时,它告诉我 Python 3.x+ 还不受支持。好的,我卸载了 Scons 和 Python,然后安装了 Python 2.7.7.

完成后,我遇到了更多困难,因为在注册表中找不到 Python。经过搜索,我找到了this answer。我提取并执行了文件。之后,Scons 成功了,但还是安装不了模块。

在查看 SConstruct 后,我​​发现 Apache 有一个硬编码路径,我已经修复了该路径。之后,我 运行 在文件夹中执行以下命令:

scons install

但回复是这样的:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /Fomod_websocket.obj /c mod_websocket.c /nologo /O2 /MD /EHsc /W3 /DWIN32 /IC
:\wamp\bin\apache\apache2.4.2\include
'cl' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [mod_websocket.obj] Error 1
scons: building terminated because of errors.

我正在使用 Windows 8 和 Wamp。我应该怎么做才能解决我面临的问题?

编辑:

这个很棒的页面帮助我解决了 cl 的问题。我需要为 Visual C++ 安装常用工具,然后我需要 运行

vcvarsall.bat x86

之后我执行了

scons install

它通过了上次失败的点。现在新的错误如下:

mod_websocket.so.manifest : general error c1010070: Failed to load and parse the
 manifest. The system cannot find the file specified.
scons: *** [mod_websocket.so] Error 31
scons: building terminated because of errors.

相对于安装 SCons 而言,安装 Visual Studio 应该无关紧要。 SCons 应该定位到 Visual Studio 每次都是 运行。您可以尝试以下操作吗:不要 运行 vcvarsall.bat、

set SCONS_MSCOMMON_DEBUG=%TEMPDIR%\scons_mstrace.log

运行 scons,然后将输出粘贴到某处并将其添加到您的问题中?

在 运行ning SCons 之前,您不需要 运行 vcvarsall.bat。如果你需要它表明 SCons 没有找到你的 Visual studio 安装。在这里设置 SCONS_MSCOMMON_DEBUG 将有助于找出失败的原因,并减轻 运行 vcvarsall.bat 的需要。有可能是MSVC初始化不完整,scons中的MSVC可能与你剩下的问题有关。

你能粘贴生成的日志文件吗?