[Original] answers to questions that cannot be compiled in the first example of "proficient in qt4 programming"

Source: Internet
Author: User

I recently started to study qt4, bought a book "proficient in qt4 programming", installed qt4 and kdevelop on my Ubuntu, and wrote it manually in the command line.Code. There is no error during compilation and it can be run successfully. However, after a qt4 project is created in kdevelop, compilation fails. the following error is reported at the link: Undefined reference to 'qapplication:: qapplication (Int &, char **, INT )'.

This is obviously because no database location is specified, and the corresponding class cannot be found during the link. After a long time of exploration, I finally found the answer on the kdevelop official website. In fact, it is very simple. First, check whether your project specified the use of qt4 instead of qt3. in project-> project options:

Click qmake manager on the right side:

Right-click the src directory, select subproject settings, and click the configuration tab:

Select the GUI library to be included. Now I can learn qt4 at ease ~~

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.