2

我已经根据安装说明安装了模拟库。以下主文件编译时没有问题 a gcc-c++ 4.1.2,但是当我升级到时gcc-c++ 4.4.7出现错误。

模拟.cpp:

#include <iostream>
#include <mimetic.h>

using namespace std;
using namespace mimetic;

int main()
{
    MimeEntity me;          
    return 0;
}

错误

In file included from /usr/local/include/mimetic/rfc822/header.h:18,
                 from /usr/local/include/mimetic/header.h:11,
                 from /usr/local/include/mimetic/mimetic.h:18,
                 from mimetic.cpp:2:
/usr/local/include/mimetic/rfc822/messageid.h:29: error: expected ‘)’ before ‘thread_id’

头文件:rfc822/messageid.h

#ifndef _MIMETIC_MESSAGEID_H_
#define _MIMETIC_MESSAGEID_H_
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <string>
#include <mimetic/libconfig.h>
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <mimetic/utils.h>
#include <mimetic/os/utils.h>
#include <mimetic/rfc822/fieldvalue.h>

namespace mimetic
{
/// Message-ID field value 
/// On Win32 Winsock library must be initialized before using this class.
struct MessageId: public FieldValue
{
    MessageId(uint32_t thread_id = 0 ); // <------ line 29
    MessageId(const std::string&);
    std::string str() const;
    void set(const std::string&);
protected:
    FieldValue* clone() const;
private:
    static unsigned int ms_sequence_number;
    std::string m_msgid;
};
}
#endif

gcc 是否有一些兼容性开关?

4

1 回答 1

3

因此,问题原来是系统配置不佳,导致 HAVE_STDINT_H 未配置,因此uint32_t未定义,并且发生错误。

于 2013-08-05T19:03:07.767 回答