qt - Qt5 programs won't compile -
i'm trying qt5 working on ubuntu 12.04. downloaded 32-bit installer http://qt-project.org/downloads , let install in home folder.
i had add ~/qt/5.1.0/gcc/bin path qmake work, when try make hello qt example (using qt4 book), when running make, cannot find qapplication
or qlabel
header. when replace them qtwidgets/qapplication
, finds header, undefined references when linking.
this command make executes:
g++ -c -pipe -o2 -wall -w -d_reentrant -fpie -dqt_no_debug -dqt_gui_lib -dqt_core_lib -i../../../../qt/5.1.0/gcc/mkspecs/linux-g++ -i. -i. -i../../../../qt/5.1.0/gcc/include -i../../../../qt/5.1.0/gcc/include/qtgui -i../../../../qt/5.1.0/gcc/include/qtcore -i. -o hello.o hello.c
i managed figure out it's qmake -project
doing wrong. when make app in qt creator (which works), .pro file has lines qt += widgets
, not there when run on command line.
i found answer using qmake --help
. says:
note: created .pro file need edited. example add qt variable specify modules required.
adding these lines .pro file solved problem:
qt += core gui qt += widgets
Comments
Post a Comment