質問

初めてGCCに切り替えると、コンパイラーがここで私に言っていることに少し混乱しています。基本的に、boost :: xpressive :: wsregexは定義されていません(私は信じています)。

関連するコードは次のとおりです。

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

これがエラーです:

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

ここで混乱しているのは、メンバーを宣言しているのに、どこか別のメンバーを使用していると文句を言うことです。

何かを #include するのを忘れましたか?

事前に感謝します、 Billy3

役に立ちましたか?

解決

cygwinとmingwはワイド文字をサポートしていないため、xpressiveもサポートしていません。 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

マクロBOOST_NO_CWCHAR、BOOST_NO_CWCTYPEおよびBOOST_NO_STD_WSTRINGは、platcorm / compiler / std-libraryのboostのconfig.hppヘッダーによって自動的に定義されます。申し訳ありません。

今後、ブーストユーザーのリストにブースト質問を投稿することで、より良い結果が得られるでしょう。

- エリック・ニーブラー BoostProコンピューティング www.boostpro.com

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top