有人为 Windows x64 编译过 PCRE - 如果是的话,如何编译?

发布于 2024-09-03 03:39:52 字数 294 浏览 4 评论 0原文

我正在尝试使用 Vs2008 为 Windows x64 编译 PCRE (v8.02)。

“NON-UNIX-USE”文件告诉我使用 cmake 生成 .sln 文件。
那行得通。

当我运行构建时,它成功了,但有 91 条警告。

所有似乎都是尺寸转换警告。

我做错了什么吗?
我应该期待所有这些警告吗?
有没有其他人成功地为 Windows x64 构建 PCRE 并且没有警告?

I'm trying to compile PCRE (v8.02) for Windows x64, using Vs2008.

The "NON-UNIX-USE" file tells me to use cmake to generate a .sln fle.
That works.

When I run the build it succeeds, with 91 warnings.

All appear to be size conversion warnings.

Am I doing something wrong?
Should I expect all these warnings?
Has anyone else built PCRE for Windows x64, successfully, and without warnings?

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

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

发布评论

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

评论(3

谈场末日恋爱 2024-09-10 03:39:52

我联系了 PCRE 的维护者;显然这些警告是预期的。
他从未在 Windows 上构建过它,更不用说 x64 上的 Windows 了。


编辑 - 自 2010 年 6 月 1 日起,他更改了最新版本的 PCRE(可在 svn://vcs.exim.org/pcre/code/trunk 获取),以消除Windows/x64 上的警告。

检查一下:

svn co svn://vcs.exim.org/pcre/code/trunk pcre

I contacted the maintainer of PCRE; apparently the warnings are expected.
He's never built it on Windows, let alone Windows on x64.


EDIT - As of 1 June 2010, he's changed the latest version of PCRE, available at svn://vcs.exim.org/pcre/code/trunk , to eliminate warnings on Windows/x64.

Check it out with:

svn co svn://vcs.exim.org/pcre/code/trunk pcre
晚风撩人 2024-09-10 03:39:52

根据 Windows 64 位数据模型的工作方式,将 32 位代码编译为 64 位通常可以正常工作。尽管标准中显然不能保证 long 和 int 具有相同的大小,LLP64 保留了这一点。事实上,它们的大小与 ILP32 中的大小相同。唯一不再安全的是尝试将指针存储在 int 中。

因此,警告可能并不意味着存在真正的问题。

The way Windows 64-bit data model works, compiling 32-bit code as 64-bit often works fine. Even though there is obviously no guarantee in the standard that long and int are the same size, LLP64 preserves this. In fact, they are the same size as in ILP32. The only thing that's no longer safe is trying to store a pointer in a int.

So the warnings probably don't mean there's a real problem.

温柔少女心 2024-09-10 03:39:52

“显然这些警告是意料之中的。他从未在 Windows 上构建过它,更不用说 x64 上的 Windows。

编辑 - 自 2010 年 6 月 1 日起,他更改了最新版本的 PCRE(可在 svn://vcs.exim.org/pcre/code/trunk 获取),以消除 Windows/x64 上的警告。”

为操作系统社区提供帮助,干得好!

作为参考,正如其他人在此处的答案中指出的那样,这些是“警告”,而不是“错误”。这意味着代码没有发生根本性的变化。从更改日志中,他添加了显式强制转换,但这纯粹是为了不打印警告。

块引用>16。添加了大量 (int) 转换以避免在以下系统中出现编译器警告
size_t 是 64 位(#991)。

然而,这确实让我们其他人在为 64 位编译 pcre 时不必担心这些问题是否应该修复。很多时候,应用程序在构建时都会带有警告,例如,考虑“已弃用”警告。这意味着代码所依赖的 API 在未来版本中可能不可用,但目前可以使用。

"apparently the warnings are expected. He's never built it on Windows, let alone Windows on x64.

EDIT - As of 1 June 2010, he's changed the latest version of PCRE, available at svn://vcs.exim.org/pcre/code/trunk , to eliminate warnings on Windows/x64."

Good job for helping the OS community!

For reference, as others have pointed out in the answers here, these were "warnings", not "errors". That means, there was no fundamental change to the code. From the change log, he added an explicit cast, but this is purely so the warnings don't print out.

blockquote>16. Added a lot of (int) casts to avoid compiler warnings in systems where
size_t is 64-bit (#991).

However, that does save the rest of us, when compiling pcre for 64-bit, from wondering whether these are something that should be fixed or not. Many times, applications will build with warnings, as one example, consider the "deprecated" warning. This means that an API the code relies on may not be available in future releases, but it will work for now.

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