首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在VES2008上编译Greta?

如何在VES2008上编译Greta?
EN

Stack Overflow用户
提问于 2013-04-09 11:14:21
回答 1查看 286关注 0票数 1

我编译了Greta来对抗VES2008,它说

代码语言:javascript
复制
error C2332: 'class' : missing tag name                                           
error C3306: 'regex::detail::<unnamed-tag>': unnamed class template is not allowed
error C2143: syntax error : missing ';' before '__builtin_alignof'                
error C2059: syntax error : '__builtin_alignof'                                   
error C2143: syntax error : missing ';' before '{'                                
error C2447: '{' : missing function header (old-style formal list?)               

相关源码片段:

代码语言:javascript
复制
template< typename T >
class alignof
{
    struct helper
    {
        helper();
        char    m_c;
        T       m_t;
    };
public:
    enum { value = sizeof(helper)-sizeof(T) < sizeof(T) ? sizeof(helper)-sizeof(T) : sizeof(T) };
};

在预编译之后,它

代码语言:javascript
复制
template< typename T >
class __alignof
{
    struct helper
    {
        helper();
        char    m_c;
        T       m_t;
    };
public:
    enum { value = sizeof(helper)-sizeof(T) < sizeof(T) ? sizeof(helper)-sizeof(T) : sizeof(T) };
};

我在谷歌上搜索后还没有找到答案。这是什么原因造成的,如何解决?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-04-09 13:03:21

尽管alignof似乎不是VS2008中的保留字,但它与_alignof如此相似,可能会混淆问题。

尝试将类的名称更改为其他名称。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15892661

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档