作者:王者荣耀戒毒所 | 来源:互联网 | 2023-09-25 13:26
IusedtowritecodewithVisualStudio,whichisprettyeasytoaddaclass.Recently,Iturntous
I used to write code with Visual Studio, which is pretty easy to add a class. Recently, I turn to use Qt Creator to write pure C++ project and there are always something wrong with adding a class. The codes are like these:
我曾经用Visual Studio编写代码,这很容易添加一个类。最近,我转而使用Qt Creator编写纯C ++项目,添加类总是有问题。代码如下:
#include
#include "hello.h"
using namespace std;
int main()
{
Hello H;
H.say();
cout <<"Hello World!" <
I created a class named Hello and include it into the main.cpp, but when I compile it, some errors will happen.
我创建了一个名为Hello的类并将其包含在main.cpp中,但是当我编译它时,会发生一些错误。
So how to add a class with QT creator? Thanks in advance!
那么如何用QT创建者添加一个类?提前致谢!
2 个解决方案