Use qtcreator for IDE development of non-qt c/C ++ programs

Source: Internet
Author: User

In Windows, I am still used to using vs2005, but now in Linux, C/C ++ programs are not as good as IDE. Although many people recommend the IDE, which is mainly developed as Java at the beginning of E, it does not feel good after installing the plug-in. One is that the smart completion function is slow in response and does not support the standard library well, the other is compilation, which is still troublesome. We cannot automatically generate a suitable makefile based on the project (or I have not found this function, so do not laugh at me when using it)

Discovering for a long time ...... I found a monkey IDE and used it for a while. It seems that it is not easy to use. It is also used to write QT programs, but it is not as good as the smart completion of qtcreator.

Therefore, in order to achieve the best development effect, he began to find a way to use qtcreator to write C/C ++ programs. He not only had a complete IDE, but also completed it intelligently and conveniently, it is also embedded with GDB, which is very convenient for debugging. It is similar to vs2005. It is more convenient to integrate version control plug-ins such as git, which can be said to be quite perfect.

In fact, qtcreator can be used to write C/C ++ programs. The only drawback is that it links two libraries to qtcore and qtgui. These two are default libraries, but generally our standard C/C ++ programs do not need these two libraries. It's easy to remove. Just use-= to create an empty document with gedit or VI and add the following content, A standard QT empty C/C ++ Project template is complete. Fill in your project name and file name in the corresponding location and save it as one. open the pro file with qtcreator.

Qt-= core Gui

Target = your project name, such as hello

Config + = console

Template = app

Sources + = Main. cpp (you can add or remove the project file here. You can enter it in qtcreator)

Main. cpp can write some code.

# Include <stdio. h>

Int main (INT argc, char * argv [])

{

Printf ("Hello world. \ n ");

Return 0

}

After opening, select the generated location to develop the Standard C/C ++ program.

Debugging is very convenient, and it is the best I have ever used. The disadvantage in the US is that the result is not easy to input from stdin. During debugging, we recommend that you directly enter the code to skip stdin In the debugging box.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.