Pregunta

Cambiar a GCC por primera vez, y me estoy confundiendo un poco por lo que el compilador me dice aquí. Esencialmente, se comporta como boost :: xpressive :: wsregex no está definido (creo).

Aquí está el código relevante:

#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);
};

Y aquí está el error:

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

Lo que me confunde aquí es que estoy declarando un miembro, pero se queja de que estoy usando un miembro en otro lugar.

¿Me he olvidado de #include algo?

Gracias de antemano, Billy3

¿Fue útil?

Solución

cygwin y mingw no admiten caracteres anchos, por lo que xpressive tampoco puede. Vea lo siguiente en 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

Las macros BOOST_NO_CWCHAR, BOOST_NO_CWCTYPE y BOOST_NO_STD_WSTRING están definidas automáticamente por el encabezado config.hpp de boost para su biblioteca platcorm / compiler / std. Lo siento.

En el futuro, obtendrás mejores resultados al publicar las preguntas de impulso en la lista de usuarios de impulso.

- Eric Niebler Informática BoostPro www.boostpro.com

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top