PDA

View Full Version : Building a static QT executable with visual studio 2010



ntp
15th February 2012, 23:34
Is a simple step by step list of how to build a static executable with already built static QT libs in visual studio? I have tried searching but so far haven't found one. I have a simple dialog with QWebView in it. I have managed to build it dynamically (though I can only run it out of the qt command window after setting my qt libraries in the path).

1>main.obj : error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __ehhandler$_main
1>webviewdialog.obj : error LNK2001: unresolved external symbol ___CxxFrameHandler3
1>webviewdialog.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) referenced in function __unwindfunclet$?setupUi@Ui_WebviewDialog@@QAEXPAV QDialog@@@Z$1
1>webviewdialog.obj : error LNK2019: unresolved external symbol "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) referenced in function "public: void __thiscall Ui_WebviewDialog::setupUi(class QDialog *)" (?setupUi@Ui_WebviewDialog@@QAEXPAVQDialog@@@Z)
1>webviewdialog.obj : error LNK2001: unresolved external symbol "const type_info::`vftable'" (??_7type_info@@6B@)
1>LINK : error LNK2001: unresolved external symbol _WinMainCRTStartup
1>LINK : error LNK2001: unresolved external symbol __load_config_used

Any suggestions welcomed.

qt 4.8.0
visual studio 2010

I have done this in the past but I don't have access to the project (and it was under visual studio 2005 so things may have changed).

Mesozoic
17th August 2013, 00:48
You'll need the following libraries to be linked in and make sure you don't include the default libs:

qtmain.lib
QtCore.lib
QtGui.lib
libcpmt.lib
libcmt.lib
ws2_32.lib
kernel32.lib
user32.lib
gdi32.lib
advapi32.lib
imm32.lib
winmm.lib
comsupp.lib
setupapi.lib