C++ Qt: undefined reference to `_imp___ZN12QApplicationC1ERiPPci' -


i trying remind myself c++, , learn qt.

i working on windows. have installed qt (5.1.0), mingw (g++ 4.6.2), gnu make (3.81).

i trying compile simple qt app. basic case this:

#include <qtwidgets> #include <qtgui>  int main (int argc, char* argv[]) {                    qapplication app(argc, argv);                       qtextstream cout(stdout);                                    return exit_success; } 

the project file is:

template = app target = example1 includepath += .  # input sources += fac1.cpp qt += gui widgets core 

when run

qmake 

it generates makefile.

but make this:

c:\src\early-examples\example1>make make -f makefile.release make[1]: entering directory `c:/src/early-examples/example1' g++ -wl,-s -wl,-subsystem,console -mthreads -o release\example1.exe release/fac1.o  -lc:\qt\qt5.1.0\\5.1.0\msvc2012_64\lib -lqt5widgets -lqt5gui -lqt5core -llibegl -llibglesv2 -lgdi32 -luser32 release/fac1.o:fac1.cpp:(.text.startup+0x2e): undefined reference `_imp___zn12qapplicationc1erippci' release/fac1.o:fac1.cpp:(.text.startup+0x37): undefined reference `_imp___zn12qapplicationd1ev' collect2: ld returned 1 exit status make[1]: *** [release\example1.exe] error 1 make[1]: leaving directory `c:/src/early-examples/example1' make: *** [release] error 2 

can tell me wrong?

the problem here appear using visual studio 2012 libraries mingw builds. need link mingw compiled qt instead.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -