How to get started with IDEs, Especially Qt Creator?

佐手、 提交于 2019-12-11 04:25:06

问题


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:

No rule to make target `all'. Stop.

Screenshot of Qt Creator


回答1:


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

  2. cout should be std::cout.

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

  4. void main is not valid. main always returns int.

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.



来源:https://stackoverflow.com/questions/44218316/how-to-get-started-with-ides-especially-qt-creator

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!