Results 1 to 3 of 3

Thread: Convert VS2010 project from Win32 to Qt5

  1. #1
    Join Date
    Oct 2009
    Posts
    38
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Convert VS2010 project from Win32 to Qt5

    I am working with a Win32 project in VS2010, and am trying to move it from being a console project to being a Qt windowing project. I have Qt Add-in 1.2.2 with Qt5.1.1.

    I looked online for how to do this, and found a number of links that seemed helpful. Particularly this one (others seem to say the same thing):

    http://stackoverflow.com/questions/2...o-a-qt-project

    But when I completed the steps that Benjamin gave in his answer, and rebuilt, I got the error message:

    error LNK1181: cannot open input file '\.obj'

    Not a very helpful link error. I am not sure if Qt4VSv1.0 is correct, and have looked all over for information as to how this keyword is to be constructed. I assume that it should start with Qt5, but I'm not sure what the v1.0 refers to. Is that the add-in version?

    I tried changing that to Qt5VSv1.2, but when I reloaded the project and right-clicked, the "Convert project to Qt Add-in project" option wasn't there, but a "Convert project to QMake generated project" was, and it was not highlighted so I couldn't select it. Changed it to Qt5VSv1.0 and got the same thing. Should I really be using the Qt4VSv1.0 keyword for Qt5.1.1 with add-in 1.2.2 on VS2010? I have no idea how to find out what this should be. And I don't really know what exactly this error is trying to tell me.

    Also, Benjamin's instructions said that I should "add" the <keyword>Qt4VSv1.0</keyword> entry into the <PropertyGroup Label="Globals"> tag, so I had both the <keyword>Win32Proj</keyword> and the <keyword>Qt4VSv1.0</keyword> entries in there. I tried starting from scratch and taking out the Win32Proj entry, but that didn't make a difference.

  2. #2
    Join Date
    Sep 2013
    Location
    Bratislava, Slovakia
    Posts
    8
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Convert VS2010 project from Win32 to Qt5

    Hi!
    First, it's important that if you are building for 32bit, you also have also 32bit version Qt and also it should have the same compilator MSVC not mingw.

    The keyword should be <keyword>Qt4VSv1.0</keyword> that is correct, I am using VS2012 and Qt5.2.1 and it is working.

    Maybe you could try newer version of Qt_vs_addin, try version 1.2.3, for example 1.2.4 is not working with VS2012, don't know why, and I am not the only one with this problem.

  3. #3
    Join Date
    Oct 2009
    Posts
    38
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Thumbs up Re: Convert VS2010 project from Win32 to Qt5

    Thanks for your reply. Yes, I think it must be something with Qt Add-in 1.2.2. I was going a little bit crazy yesterday, since (as always happens when you run into something like this) I'm under a pretty tight deadline. I finally made a copy of my whole solution folder, and then reverted the original back to a buildable copy from SVN (thanks SVN!!), and then I diffed the .vcxproj in the reverted folder to the one that wasn't working. I tried manually changing stuff in the one that wasn't working and compiling, and what I found was that the 1.2.2 add-in had put a $(INHERIT) variable into some places. In one of those places it had the form: <some_previous>\;$(INHERIT)\;<some_next> ... So somehow it messed up. I removed the backslashes and it just compiled like ever before. So though I don't have time to be sure right now, I'm thinking you are probably correct about the add-in version. Thanks again.

Similar Threads

  1. Qt5 project in VS2010 cannot be built: Error MSB6006
    By Brokenmind in forum Qt Programming
    Replies: 3
    Last Post: 20th September 2013, 07:45
  2. How to link win32 dll to project?
    By libed in forum Qt Programming
    Replies: 7
    Last Post: 22nd July 2011, 16:22
  3. Replies: 1
    Last Post: 5th April 2011, 11:58
  4. how to use Qt dll in Win32 project
    By Fastman in forum Qt Programming
    Replies: 8
    Last Post: 10th July 2009, 12:16
  5. compiling a qt project under win32
    By elcuco in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2006, 07:43

Tags for this Thread

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.