0

我已经看到了这个问题:头文件和源文件之间的“类类型重新定义”错误

如果您只是重复上述问题,请先检查下面的代码。

问题是“类类型重新定义”不应该发生,因为我认为我做得正确。

这是代码。

TTSpeech.h

#include <wtypes.h>
#include <string>
#include <vector>

class TTSpeech
{
  public:
    enum State
    {
        State_Loaded,
        State_Unloaded,
    };

    TTSpeech();
    virtual ~TTSpeech();

    virtual bool isAvailable() = 0;

    virtual bool load() = 0;
    virtual bool unload() = 0;

    virtual bool isLoaded() const = 0;

    virtual bool say(const std::string &sentence) = 0;

    virtual bool setVolume(int volume) = 0;
    virtual bool setPitch(int pitch) = 0;
    virtual bool setRate(int rate) = 0;

    virtual bool setVoice(const std::string &voice) = 0;

    virtual std::vector<std::string> getVoices() const = 0;
};

TTSpeech.cpp

#include "TTSpeech.h"

TTSpeech::TTSpeech()
{
//code
}

TTSpeech::~TTSpeech()
{
//code
}

我所做的唯一不寻常的事情是从解决方案中删除文件,将上述文件重新定位到一个文件夹,因为这个问题:cannot open include no such file or directory。然后将文件重新添加到解决方案中。我正在使用运行 Windows 8 的 Visual Studio 2012

4

0 回答 0