【发布时间】:2009-10-24 03:33:27
【问题描述】:
第一次切换到 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 什么了吗?
提前致谢, 比利3
【问题讨论】:
-
我假设在criteria.h或前面省略的代码中都有regexClass的定义?
-
是的,它是criteria.h中的
#defined。 -
您能否确保标头搜索路径正确,即 Boost 库正确包含在您的源代码中?
-
其他 boost 库运行正常。
标签: c++ mingw boost-xpressive