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++?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Sure you can. Although it is more convenient with qmake or CMake, you can do:
or
(in a makefile)
Update – invoking
moc:Quote from moc manpage:
I’d personally name the output rather
%.moc.cpp(thanm%.cpp). You then add the dependency ofmy_progonmy_prog.moc.cppSimilarly 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: