How do I set up Qt paths in Visual Studio 2010?

前端 未结 4 2033
没有蜡笔的小新
没有蜡笔的小新 2021-02-06 04:33

I just downloaded and installed the latest versions of the Qt SDK, Qt Creator, and the Qt add-in for Visual Studio (I\'m running VS 2010).

First, I tried creating a Qt pr

相关标签:
4条回答
  • 2021-02-06 04:48

    Firstly, it's quite normal that MinGW libraries don't work with Visual Studio. Read up on the subject if you're still angry.

    The Qt SDK (if that's what you downloaded, should come with a pre-installed QtCreator that works with minimal or no setup with the included MinGW toolchain.

    If you want to use Visual Studio with the add-in, you'll need to either try the Visual Studio 2008 download from this webpage or rebuild Qt yourself. It's not hard, just time-consuming. Pointing the add-in to the build or install location of either of those should get you going.

    0 讨论(0)
  • 2021-02-06 04:48

    When you had older versions of Qt installed before, even if you uninstall them diligently, registry entry for Trolltech will still contain old values. To fix that, start Registry Editor (regedit.exe), scroll to:

    HKEY_CURRENT_USER\Software\Trolltech\Versions\DefaultQtVersion

    and edit it to current version number. Check other entries in Trolltech group, to make sure they are set to current version. That solved the problem of

    Unable to find a Qt build! To solve this problem specify a Qt build

    for me.

    0 讨论(0)
  • 2021-02-06 04:54

    I'm almost positive that you have to rebuild the Qt libraries in Visual Studio first before you can use them. That probably explains why you're getting the error message that a Qt build can't be found, and that the version of Qt you're using was built with MinGW.

    I suggest reading this blog post for what looks to be a solid how-to guide on integrating Qt with VS.

    This looks like an even simpler guide, although it's in PDF format: Qt Installation for Visual Studio

    0 讨论(0)
  • 2021-02-06 05:07

    Rebuild it with vs2010, it's much easier, and allows you to step into the Qt src in debug.

    In the top of the Qt src tree do
    configure -no-webkit -no-qt3support -opensource -platform win32-msvc2010
    (webkit is optional but it takes a long time to build)

    Will build a .sln file which you can open in VS2010 and build

    0 讨论(0)
提交回复
热议问题