Results 1 to 8 of 8

Thread: Use an application created in QT5 with mingw compiler in Microsoft Visual Studio 2010

  1. #1
    Join Date
    Apr 2013
    Posts
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Use an application created in QT5 with mingw compiler in Microsoft Visual Studio 2010

    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.

  2. The following user says thank you to Search for this useful post:


  3. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use an application created in QT5 with mingw compiler in Microsoft Visual Studio

    Quote Originally Posted by Search View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. The following user says thank you to wysota for this useful post:


  5. #3
    Join Date
    Apr 2013
    Posts
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Use an application created in QT5 with mingw compiler in Microsoft Visual Studio

    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:n_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:n_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

  6. The following user says thank you to Search for this useful post:


  7. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use an application created in QT5 with mingw compiler in Microsoft Visual Studio

    What if you build with QtCreator using MSVC?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. The following user says thank you to wysota for this useful post:


  9. #5
    Join Date
    Apr 2013
    Posts
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Use an application created in QT5 with mingw compiler in Microsoft Visual Studio

    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.

  10. The following user says thank you to Search for this useful post:


  11. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use an application created in QT5 with mingw compiler in Microsoft Visual Studio

    The problem is Creator can't find your MSVC installation. Did you set it up in the settings?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. The following user says thank you to wysota for this useful post:


  13. #7
    Join Date
    Apr 2013
    Posts
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Use an application created in QT5 with mingw compiler in Microsoft Visual Studio

    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?

  14. The following user says thank you to Search for this useful post:


  15. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Use an application created in QT5 with mingw compiler in Microsoft Visual Studio

    Open Creator's settings, go to "Build and Run" pane and have fun.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  16. The following user says thank you to wysota for this useful post:


Similar Threads

  1. Replies: 2
    Last Post: 24th December 2011, 01:19
  2. HowTo get work Microsoft VS 2010 and Qt Visual Studio Add-in?
    By NewLegend in forum Installation and Deployment
    Replies: 15
    Last Post: 17th October 2010, 19:15
  3. Visual Studio Plugin (1.1.6) crashes Visual Studio (2010)
    By mboeni in forum Installation and Deployment
    Replies: 0
    Last Post: 11th October 2010, 17:46
  4. MingW x Visual Studio compiler
    By john_god in forum Installation and Deployment
    Replies: 2
    Last Post: 22nd September 2008, 18:06
  5. Replies: 7
    Last Post: 24th March 2007, 14:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.