MinGW 下的 Boost::Xpressive 编译难题
第一次切换到 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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
cygwin 和 mingw 不支持宽字符,因此 xpressive 也不支持。请参阅 xpressive_fwd.hpp 中的以下内容:
宏 BOOST_NO_CWCHAR、BOOST_NO_CWCTYPE 和 BOOST_NO_STD_WSTRING 由 boost 的 config.hpp 标头自动为您的 platcorm/compiler/std-library 定义。对不起。
将来,您将 boost 问题发布到 boost 用户列表中将会获得更好的结果。
--
埃里克·尼伯勒
BoostPro 计算
www.boostpro.com
cygwin and mingw do not support wide characters, so xpressive can't either. See the following from xpressive_fwd.hpp:
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