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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:09:57+00:00 2026-05-16T15:09:57+00:00

I want to program using Qt, but I don’t want to use special compilers

  • 0

I want to program using Qt, but I don’t want to use special compilers or IDE such as Qt Creator and qmake. I want to write with Kate and compile with g++.

Can I compile a program that uses Qt with g++? How do I compile it with g++?

  • 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-05-16T15:09:58+00:00Added an answer on May 16, 2026 at 3:09 pm

    Sure you can. Although it is more convenient with qmake or CMake, you can do:

    CXXFLAGS += -Ipath_to_your_qt_includes
    LDFLAGS += -Lpath_to_your_qt_libs
    
    LDLIBS += -lqt-mt (for Qt3)
    

    or

    LDLIBS += -lQtCore -lQtGui (for Qt4, add what you need)
    
    my_prog: my_prog.cpp
    

    (in a makefile)

    Update – invoking moc:

    Quote from moc manpage:

    Here is a useful makefile rule if you
    only use GNU make:

    m%.cpp: %.h
            moc $< -o $@
    

    I’d personally name the output rather %.moc.cpp (than m%.cpp). You then add the dependency of my_prog on my_prog.moc.cpp

    my_prog: my_prog.cpp my_prog.moc.cpp
    

    Similarly for uic. The situation here is more complicated, since you have to generate rules for headers and source files, and you have to add a dependency on a header file to ensure it gets generated before the sources are compiled. Something like this might work:

    my_prog: my_prog.o my_prog.moc.o my_prog.ui.o
            $(CXX)  $(LDFLAGS) -o my_prog $^ $(LDLIBS)
    
    my_prog.o: my_prog.cpp my_prog.ui.h
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ofstream() to write data into file, i want the program to
I want to write a program to find the n-th smallest element without using
I want to program the jquery slider myself rather than using any plugin. But
I've been wanting to write a music program for a while, but I don't
I'm using the Process Class to start processes, but don't ever want more than
I'm using Wordpress to manage posts in my website, but I don't want to
i developed client server program using c++,so i want to receive more than 500kb
I want to compile a simple hello-world-style program using the Windows command line. cl
I have a program using odac(11.2) and oracle client 11.2. Now I want to
I'm new to C programming. I want to compile C program using Make file.

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.