[pcre-dev] Building PCRE with CMake 2.6 and Visual C++ .NET …

Αρχική Σελίδα
Delete this message
Συντάκτης: Vincent Krzyzanowski
Ημερομηνία:  
Προς: pcre-dev
Αντικείμενο: [pcre-dev] Building PCRE with CMake 2.6 and Visual C++ .NET 7.1.3088
Hello,

I'm having a little trouble getting PCRE to work under my environment. I ran
CMake under the MSVC++ command prompt and the solution file was generated
correctly. Opening and compiling the output from CMake was straightforward,
and a pcre.lib file was generated.

When I attempt to link to the pcre.lib file in the following example, things
get a little weird:

// main.cpp
#include <pcre.h>

int main()
{
    pcre*    re;
    return 0;
}


// end main.cpp

I am presented with one link error, as follows:

MSVCRT.lib(MSVCR71.dll) : error LNK2005: _memmove already defined in
LIBC.lib(memmove.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
libs; use /NODEFAULTLIB:library
Release/pcre test.exe : fatal error LNK1169: one or more multiply defined
symbols found

I got around the problem by specifying /NODEFAULTLIB:LIBC.lib, but that's
just a hack. I'm wondering if any of you know of the correct way around
this.

Thanks,
Vince