SWIG 构建调试工具/技巧

发布于 2024-10-13 08:56:47 字数 764 浏览 6 评论 0原文

我正在尝试使用 OpenSSL 1.0.0c(或 0.9.7m),适用于 Windows 上的 Python 2.5.4,但 SWIG 正在密谋反对我。我尝试过 SWIG 2.0.1 和 SWIG 1.3.40,但出现相同的错误:

swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
C:\Development\swigwin-1.3.40\swig.exe -python -IC:\Development\Python-2.5.4\include -IC:\Development\Python-2.5.4\PC -Ic:\Development\openssl-0.9.7m\include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
c:\Development\openssl-0.9.7m\include\openssl\opensslv.h(1): Error: Syntax error in input(1).

OpenSSL/SWIG 的所有排列都显示此错误。我尝试过手动调用 swig 并传递所有可能的“额外详细”选项,但它们都没有提供足够的信息。我还能做什么来尝试找到这个问题的真正根源?

(此站点上有建议编辑 M2Crypto 的 .i 文件,但 0.21.1 已经集成了建议的更改)

I am trying to build M2Crypto 0.21.1 with OpenSSL 1.0.0c (or 0.9.7m) for Python 2.5.4 on windows, but SWIG is conspiring against me. I've tried both SWIG 2.0.1 and SWIG 1.3.40 and I get the same error:

swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
C:\Development\swigwin-1.3.40\swig.exe -python -IC:\Development\Python-2.5.4\include -IC:\Development\Python-2.5.4\PC -Ic:\Development\openssl-0.9.7m\include -includeall -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
c:\Development\openssl-0.9.7m\include\openssl\opensslv.h(1): Error: Syntax error in input(1).

All permutations of OpenSSL/SWIG show this error. I've tried invoking swig by hand and passing all the "extra verbose" options I could, but none of them are even close to informative. What else can I do to try to find the true source of this problem?

(There are suggestions on this site to edit the .i file for M2Crypto, but 0.21.1 already has the suggested changes integrated)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

骄傲 2024-10-20 08:56:47

实际上,这里的问题不是 SWIG,但我会将这个问题/答案留给下一个出现的 M2Crypto 用户 - 也许这会对他们有所帮助。

问题是 M2Crypto setup.py 默认指向 /include,但如果该 openssl 目录是源代码树,则 include/ 不是没有正确的查找位置(至少在 Windows 上) - 您需要在 inc32/ 中查找,否则 opensslv.h 只是指向不同文件的一行,这就是 SWIG 在第 1 行爆炸的原因。

Actually the problem here isn't SWIG, but I'll leave this question/answer for the next M2Crypto user that comes along - maybe it will help them.

The problem is that the M2Crypto setup.py by default points to <your openssl dir>/include, but if that openssl directory is the source tree, include/ isn't the right place to look (on windows at least) - you need to be looking in inc32/, otherwise opensslv.h is just a line pointing to a different file, which is why SWIG bombs out on line 1.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文