c++ - 使用包含文件(自己的类)编译时出错

标签 c++ class compilation include

信息:Microsoft Visual Studio 2012 Ultimate、Windows 8 Professional、C++。 我有一个问题...

QIClassStringOperations.hpp

#include "Q.hpp"
class QIClassStringOperations
{
    public:
        virtual void FromString(const QString& Str) = 0;
        virtual QString ToString() = 0;
};

Q.hpp

#include "QString.hpp"

QString.hpp

template <typename Type> class CString
{
    //...
};
typedef CString<char> QString;

在编译时出现这个错误:

c:\...\QIClassStringOperations.hpp(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

这一行的问题:

virtual void FromString(const QString& Str) = 0;

抱歉我的英语不好 :)。 你能帮帮我吗?

最佳答案

看起来 QString 没有被识别为一个类型? 在哪里声明 QString?

关于c++ - 使用包含文件(自己的类)编译时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16341505/

相关文章:

c++ - 等待 atomic_bool

c++ - 将多个元素添加到 map<pair> c++

c++ - 错误 : called object type 'int' is not a function or function pointer

ios - 注销时快速清除共享实例

c++ - 不用g++编译c代码的主要原因是什么?

java - 玩框架。无需编译

Typescript Compiler - bundle 外部库

c++ - 仅使用 8 字节 CAS 无锁? C++

java - 获取和设置方法不更改数组

java - 在 Java 中实现新的 LinkedList 方法