views:

135

answers:

1

Hello all :)

Switching to GCC for the first time, and I'm getting a bit confused by what the compiler is telling me here. Essentially, it's behaving like boost::xpressive::wsregex is not defined (I believe).

Here is the relevant code:

#include "criterion.h"
#include <string>
#include <boost/xpressive/xpressive.hpp>

//More lines of code omitted here

class perlRegex : public regexClass
{
private:
    std::wstring regexString;
    boost::xpressive::wsregex regex;   // This is the line complained about
public:
    unsigned __int32 getPriorityClass() const;
    BOOL include(fileData &file) const;
    unsigned int directoryCheck(const std::wstring& /*directory*/) const;
    std::wstring debugTree() const;
    perlRegex(const std::wstring& inRegex);
};

And here is the error:

regex.h:46: error: using-declaration for non-member at class scope
regex.h:46: error: expected `;' before "regex"

What I'm confused about here is that I'm declaring a member, yet it complains that I'm using a member somewhere else.

Have I forgotten to #include something?

Thanks in advance, Billy3

+4  A: 

cygwin and mingw do not support wide characters, so xpressive can't either. See the following from xpressive_fwd.hpp:

#if defined(BOOST_NO_CWCHAR) | \
    defined(BOOST_NO_CWCTYPE) | \
    defined(BOOST_NO_STD_WSTRING)
# ifndef BOOST_XPRESSIVE_NO_WREGEX
#  define BOOST_XPRESSIVE_NO_WREGEX
# endif
#endif

The macros BOOST_NO_CWCHAR, BOOST_NO_CWCTYPE and BOOST_NO_STD_WSTRING are defined automatically by boost's config.hpp header for your platcorm/compiler/std-library. Sorry.

In the future, you'll get better results posting boost questions to the boost users' list.

-- Eric Niebler BoostPro Computing www.boostpro.com

Eric Niebler
Guess I'm stuck with Microsoft's compiler then :(
Billy ONeal
Wow! Not every day you get an answer from the author of the library. Thanks again :)
Billy ONeal