Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has anyone compiled PCRE for Windows x64 - if so, how?

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?

like image 940
Cheeso Avatar asked May 30 '10 02:05

Cheeso


3 Answers

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
like image 175
Cheeso Avatar answered Nov 08 '22 09:11

Cheeso


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.

like image 3
Matthew Flaschen Avatar answered Nov 08 '22 11:11

Matthew Flaschen


"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.

like image 3
michaelok Avatar answered Nov 08 '22 11:11

michaelok