How to get started with IDEs, Especially Qt Creato

2019-08-13 22:29发布

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条回答
Anthone
2楼-- · 2019-08-13 23:13
  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.

查看更多
登录 后发表回答