PDA

View Full Version : Use an application created in QT5 with mingw compiler in Microsoft Visual Studio 2010



Search
17th April 2013, 06:04
Hi; I have an application created in Qtcreator using Qt5 with MinGW compiler and I want to use this code in Microsoft Visual Studio 2010 because I need to use some Opencv functions and I can't compile Opencv with Qt support using Mingw 32 compiler. How can I migrate my application from Qtcreator to MSVC 2010?
I try using the Qt5 Add In for visual studio and select the option to open Qt project but when i try to compile a link error apear.
I'm new in Qt

Thanks for your answer.

wysota
17th April 2013, 06:31
How can I migrate my application from Qtcreator to MSVC 2010?
Rebuild the application with MSVC. Of course you need Qt for MSVC installed (or built).


I try using the Qt5 Add In for visual studio and select the option to open Qt project but when i try to compile a link error apear.
You don't need the add-in. You can compile from within Qt Creator.

Search
18th April 2013, 03:36
When I build with visual studio 2010 (previously build the Qt library for visual studio) a link error appear:

moc_formulario1.obj : error LNK2019: sÃ*mbolo externo "private: void __cdecl formulario1::on_Bcontinuar_clicked(void)" (?on_Bcontinuar_clicked@formulario1@@AEAAXXZ) sin resolver al que se hace referencia en la función "private: static void __cdecl formulario1::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@formulario1@@CAXPEAVQObject@@ W4Call@QMetaObject@@HPEAPEAX@Z)
1>moc_formulario6.obj : error LNK2019: sÃ*mbolo externo "private: void __cdecl formulario6::on_toolButton_3_clicked(void)" (?on_toolButton_3_clicked@formulario6@@AEAAXXZ) sin resolver al que se hace referencia en la función "private: static void __cdecl formulario6::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@formulario6@@CAXPEAVQObject@@ W4Call@QMetaObject@@HPEAPEAX@Z)
1>debug\\bakerbotv1p0.exe : fatal error LNK1120: 2 externos sin resolver
1>
1>ERROR al compilar.

With qtcreator using mingw compiler it runs smoothly

wysota
18th April 2013, 06:27
What if you build with QtCreator using MSVC?

Search
18th April 2013, 19:34
I download Qt for Windows 32 bits (VS 2010) which includes Qtcreator but when i try to compile an application an error appear "cl is not recognized as an internal or external command, operable program or batch file." What could be the problem?
Thanks for your answer.

wysota
18th April 2013, 19:57
The problem is Creator can't find your MSVC installation. Did you set it up in the settings?

Search
18th April 2013, 21:37
Hi, thanks for your answer I'm newbie in Qtcreator and I don't know how set it up the compiler. I run an application after downloading the files of the Qt page and it gives me that error.
Could you explain or give me a link where i can see the steps to configure it?

wysota
18th April 2013, 22:39
Open Creator's settings, go to "Build and Run" pane and have fun.