Building PCRE on windows.

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
granx
Quite a regular
Quite a regular
Posts: 80
Joined: Fri Apr 29, 2005 21:58

Building PCRE on windows.

Postby granx » Wed Oct 11, 2006 18:53

Hi, I wanted to build PCRE from scratch so that I knew what compile options were being used. I am working on Windows with Visual Studio and I found the PCRE doesn't have an official build solution for this compiler. However, they have some user contributions and I found this one quite helpful.

So, with PCRE finally built with MSVC, I tried to build CEGUI's SVN trunk, which is from last week sometime. I made sure the CEGUIBase project file would locate the dependencies' headers/libraries. I get this error upon linking CEGUIBase, release build:
unresolved external symbol _pcre_free referenced in function "public: void __thiscall CEGUI::RegexValidator::release(void)" (?release@RegexValidator@CEGUI@@QAEXXZ)

I looked for that 'pcre_free' symbol in the PCRE source code (pcre.h), and it is defined differently for builds that have the preprocessor macro "VPCOMPAT" defined, which appears to be for the Virtual Pascal support. Why am I seeing this link error when building CEGUI? Does it make sense to just add this preprocessor and rebuild PCRE?

User avatar
granx
Quite a regular
Quite a regular
Posts: 80
Joined: Fri Apr 29, 2005 21:58

Postby granx » Wed Oct 11, 2006 23:18

OK I fixed it.

First off, when building PCRE with the MSVC project files I mentioned, you need to add these preprocessor defines:
PCRE_DEFINITION
DLL_EXPORT
I believe '_WIN32; is already listed, but make sure it's in there too.

Next, when building CEGUI against PCRE, '_WIN32' must be defined, and 'PCRE_STATIC' must NOT be defined.

Actually, I just embarrassed myself. I realized all this work was for using PCRE as a DLL rather than a static library. The project files I found were building a DLL, which is probably most common, but CEGUI wants a static library built, so you'll need to tweak those project settings...well, that's what you'll need if you want to do the same. Sorry for the inconvenience.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Thu Oct 12, 2006 11:11



Return to “Help”

Who is online

Users browsing this forum: No registered users and 16 guests