Results 1 to 4 of 4

Thread: QTDIR in VS2005?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2006
    Location
    San Francisco, CA
    Posts
    186
    Qt products
    Qt4
    Platforms
    MacOS X Windows
    Thanks
    55
    Thanked 12 Times in 11 Posts

    Default QTDIR in VS2005?

    I build a second configuration of a Qt build (statically linked libraries) in a folder (D:\staticqt\qt-win-commercial-src-4.2.2) and want to link to it. So I add a Qt build to Tools->Options->Qt->Builds at this path. And then I set the "Default Qt Version" to this build.

    Now, is the QTDIR environment variable supposed to change to where I point this? Because it doesn't seem to be happening; it still assumes QTDIR is at C:\Qt\4.2.2.
    So I have to hardcode the directory into compile paths if I want it to compile and link correctly. Yuck. There must be a better way...
    Software Engineer



  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: QTDIR in VS2005?

    There should be something called "Change Qt version" or similar when opening the context menu over the solution in the solution explorer.
    J-P Nurmi

  3. #3
    Join Date
    Jun 2007
    Posts
    62
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 1 Time in 1 Post

    Default Re: QTDIR in VS2005?

    I do not know if this forum frowns upon raising ancient threads from the dead. I apologize in advance.

    I'm using a commercial version of Qt for Windows. When it installs, the program start menu has a shortcut called "Visual Studio with Qt 4.2.3". This invokes the qtvars.bat file in my C:\Qt\4.2.3\ folder. That batch file among other things sets QTDIR=C:\Qt\4.2.3

    So when I made a statically linked version of Qt (in C:\Qt\4.2.3-static), I made a new qtvars.bat in the static folder's \bin\ directory. It includes set QTDIR=C:\Qt\4.2.3-static and set PATH=C:\Qt\4.2.3-static\bin;%PATH%

    I then made a new start menu shortcut by copying the old "Visual Studio with Qt 4.2.3" shortcut, renaming it "Visual Studio with Qt 4.2.3-Static", and editing the Target and Start In fields from "\4.2.3\" to "\4.2.3-static\"

    If I want to compile a shared version I invoke "Visual Studio with Qt 4.2.3", otherwise I use "Visual Studio with Qt 4.2.3-Static", to ensure that the QTDIR variable is set properly.

    I do not know it this is the preferred solution, but it seems to work.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: QTDIR in VS2005?

    I've myself used the same approach too and IMHO it's just fine.
    J-P Nurmi

Similar Threads

  1. WCHAR to QString giving error in vs2005
    By ucomesdag in forum Qt Programming
    Replies: 2
    Last Post: 1st May 2008, 23:25
  2. Do not use VS2005 SP1 with Qt4
    By ChristianEhrlicher in forum Installation and Deployment
    Replies: 21
    Last Post: 2nd February 2008, 14:48
  3. Qt 4.1.4 on VS2005 error- cannot open input file 'qtmain.lib'
    By Ashish in forum Installation and Deployment
    Replies: 10
    Last Post: 11th October 2006, 16:05
  4. Debuging Qt4 in VS2005
    By derick in forum Qt Programming
    Replies: 6
    Last Post: 20th August 2006, 20:55
  5. Installing Qt 4.1.4 (open source) on windows with vs2005
    By Randulf in forum Installation and Deployment
    Replies: 1
    Last Post: 19th August 2006, 12:22

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
  •  
Qt is a trademark of The Qt Company.