c++ - "Unresolved external symbol" errors when creating a Qt GUI application with Visual Studio 2010 -
i trying make simple gui application, on top of c++ code wrote. problem simplifed following:
#include <qtgui\qdialog> void setup(int argc, char **argv) { qdialog dlg; } int main(int argc, char **argv) { setup(argc, argv); }
i configured qt library, , pretty sure libraries compatible visual studio 2010 (other projects worked fine), don't know if should create header file. receiving these errors:
>main.obj : error lnk2001: unresolved external symbol "public: virtual __thiscall qdialog::~qdialog(void)" (??1qdialog@@uae@xz) 1>main.obj : error lnk2001: unresolved external symbol "public: __thiscall qdialog::qdialog(class qwid.................
the errors got signals vs compiler cannot determine addresses of invocation external functions you've used, namely ctor , dtor qdialog class object. avoid such errors should specify location of libraries containing definitions of functions. in order achieve should use "project properties"->"configuration properties"->"linker"->"input", in "additional dependencies" line input absolute path external libs (e.g. "c:\qt\4.8.3\lib\qtgui.lib").
i suppose if got errors mentioned set include paths correctly. specifying input libraries should help.
for future i'd suggest install qt vs add-in. adds options ordinary vs "create new project" dialog, can choose "new qt project" , required paths set automatically.
Comments
Post a Comment