Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7984925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:25:38+00:00 2026-06-04T11:25:38+00:00

So I have started a new Qt console project; everything so far has been

  • 0

So I have started a new Qt console project;

everything so far has been working fine. I have eclipse set up with the integration, but i’m not actually using it, i have just included the relevant Qt directories so that my #include <QtGui> calls work.

These have all worked perfectly so far.

i can compile it either using eclipse’s build option, or by doing

qmake -project
qmake
make

from the command line. Both work.

the include statements i have; are:

#include <QtGui>
#include <QApplication>

In two different files.

If i add anotherone though, i.e. #include <QSqlDatabase> then eclipse recognises the include, and lets me initialise new variables, and use the QSqlDatabase classes. Everything seems fine – see here – eclipse screenshot

When i build the project though, it decides it can’t see the files even though they are all there, see them here in the terminal too. And then eclipse puts red lines everywhere.

If i go into the directory, and attempt to do it all via the terminal, using the qmake -project; qmake; make then i get the same errors.

If however, I go into the .pro file created by qmake -project, and add the line QT += sql, and then do qmake; make, then all is fine and it works.

Why is qmake -project leaving out these files from the project file? I’d really rather not have to go in and manually add that line every time I build it…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:25:39+00:00Added an answer on June 4, 2026 at 11:25 am

    Why is qmake -project leaving out these files from the project file?

    As far as I know, qmake isn’t supposed to replace human programmer. If you want to know WHY it doesn’t detect SQL dependency, you can read qmake source code.

    I’d really rather not have to go in and manually add that line every time I build it…

    It sounds like you’re trying to do something weird here. You don’t need to call qmake -project before every build.

    qmake -project generates initial project – *pro file. Once initial project has been generated, you can tweak it, and add options or some macro magic if you want. Then, using *.pro file, you generate script for your build system (vcproj for windows, makefiles for windows/*nix, nmake make files, etc).

    Workflow goes like this:

    1. qmake -project.
    2. Repeat forever:
      2.1. modify generated *.pro file to your liking.
      2.2 qmake
      2.3 Build using your build system. (nmake, make, visual studio, etc.)

    To simply “build” all you have to do is #2.3. You call qmake (without -project) switch only if you modified *.pro file.

    See qt documentation and tutorials for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started a new mvc project and clicked on project\properties\web - use local
I have just started a new project, and I am using the Delphi 2009
I have started a new project on iPad.I would like to know the method
I JUST started a new XCode Project. The code I have added in so
I started with a Universal app project but have changed it to iPhone only
I started a new blank console app project in VS (I am using VS2010),
I have started a new web application and have decided to use jquery as
Okay so I have started a new language in class. We are learning Scheme
I am new with wordpress. I have started learning wordpress from today. I went
Guys i am very new to jQuery. I have started using the auto complete

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.