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 want to use the java.util.Preferences API but I don't want my program to
I want to program the jquery slider myself rather than using any plugin. But
I'm using the Process Class to start processes, but don't ever want more than
In c program, I want run c++ library function(s), but I don't know how
I'm working on a very basic scheduled FTP program, but I don't want to
I want to write a program in which plays an audio file that reads
I want to write a program that would print every combination of a set
I want to write a program in C/C++ that will dynamically read a web
I'm writing a cross-platform C++ program using Qt and I want to package/embed a
I'm new to using WPF. I have the following program I want to create:

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.