如何开始使用 IDE,尤其是 Qt Creator? [英] How to get started with IDEs, Especially Qt Creator?

查看:39
本文介绍了如何开始使用 IDE,尤其是 Qt Creator?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名高中生,只用 Turbo C++ 编写过代码.我不知道 IDE 是如何工作的,我安装了 Qt Creator 来开始学习 GUI 编程,但我什至无法让它运行简单的 C++ 代码.我不知道要包含哪些文件.注意:我是个新手.我在 YT 上找到的教程令人困惑且不清楚.我不知道为什么会这样.这是我的代码:

I'm a highschool student, who have only ever coded in Turbo C++. I have no idea how IDEs work, I installed Qt Creator to start learning GUI programming but I can't even get it to run a simple C++ code. I doesn't know what files to include. NOTE: I'm a total newbie. The tutorials I found on YT are confusing and not clear. I have no idea why this is happening. This is my code:

#include<IOSTREAM.H>
#include<CONIO.H>

void main() {
    clrscr();
    cout << "Hello World!";
    getch();
}

我确实构建了所有,然后运行,但我遇到了这个问题:

I did build all, then run but I got this Issue:

没有将目标设为all"的规则.停止.

No rule to make target `all'. Stop.

Qt Creator 截图

Screenshot of Qt Creator

推荐答案

  1. clrscr() 是特定于 Windows 的(或者是特定于 Turbo C++ - 我忘记了),无论如何;不要使用它.

  1. clrscr() is Windows specific (or is it Turbo C++ specific - I forget), in any case; don't use it.

cout 应该是 std::cout.

你应该包括iostream"而不是那些过时的.h"版本(此外,标题名称是小写的,而不是大写的).

you should include "iostream" not those obsolete ".h" versions (besides, the header names are lowercase, not uppercase).

void main 无效.main always 返回 int.

注意:这些错误与 Qt 或 qtcreator 无关.它们只是您代码中的简单明了的错误.阅读 Qt 文档并尝试一些教程.

Note: these bugs have nothing to do with Qt nor qtcreator. They are just, plain and simple, bugs in your code. Read Qt documentation and try out some tutorials.

这篇关于如何开始使用 IDE,尤其是 Qt Creator?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆