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 8782343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:32:29+00:00 2026-06-13T20:32:29+00:00

I would like to write a GUI app using Qt and SOCI. How to

  • 0

I would like to write a GUI app using Qt and SOCI. How to write a good *.pro file to compile a project with no errors? I wrote this:

QT       += core gui

TARGET = example-project
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp

HEADERS  += mainwindow.h

FORMS    += mainwindow.ui

INCLUDEPATH += /usr/local/include/soci\
                /usr/include/postgresql/
LIBS += -lsoci_core -lsoci_postgresql -ldl -lpq

and it works but I don’t know if it’s correct.

  • 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-13T20:32:30+00:00Added an answer on June 13, 2026 at 8:32 pm

    The .pro file you wrote looks good, the INCLUDEPATH /usr/include/postgresql/ may not need a trailing slash, however, the way to tell if it will produce “no errors” is to try it. The INCLUDEPATH definition will let you use headers from those directories like this:

    #include <header.h>
    

    instead of:

    #include "/usr/include/postgresql/header.h"
    

    The LIBS+= section should only contain the libraries from SOCI that contain symbols that you reference in your code. If you are statically compiling your program it will bundle these libraries into your binary, increasing its size.

    There are a lot of features you can easily add with the .pro file, and it’s helpful to know how to write one, for example you can add an application icon for Mac OS programs by adding the line:

    ICON = Icon.icns
    

    Have a look at the Qt 4.7 .pro file reference.

    You can always use an auto-generated .pro file by navigating to the directory that your source is in (in a terminal), and using the command:

    qmake -project
    

    In my experience, the auto generated .pro file is usually incomplete, but it gives you a standard of comparison and sometimes includes stuff that you would otherwise forget.

    A final method of .pro file authoring is from the QtCreator IDE. It automatically adds and subtracts things from your pro file as you add/subtract them from your project, it’s especially simple to add forms and resources in this environment.

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

Sidebar

Related Questions

I would like to write a GUI application for management of information (text documents).
I would like to put in a background gradient using the NetBeans GUI Builder.
I would like to write a somewhat complex web gui application. It will be
I would like to write an abstract base class class func_double_double_t : public unary_function<double,
I would like to write a function that creates a plot of a set
I would like to write an if statement that would continue to repeat a
I would like to write a query that returns a single date value, that
I would like to write a League Fixture generator in python, but I can't.
I would like to write to functional test for one of my rails 3
I would like to write a cross-platform function in C++ that contains system calls.

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.