I'm trying to compile a simple Qt program using g++ but I don't know how to link the libraries/headers properly and which flags to use. I can do it fine with qmake and make but I'd really like to be able to do this by only using g++.
Anyone know how to do this?
Thanks
Do it once with qmake
and make
. If you did not use CONFIG += silent
, then make
will show you which commands it is running.
Also you have to keep in mind that you may have to run moc
on some header files (those containing Q_OBJECT
) to generate .cpp files that you will then need to compile.
The exact flags you need to pass to g++ depends on your system and Qt install: is Qt in your PATH ? Where is it installed ? Which Qt libraries are you using ? etc.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.