Results 1 to 10 of 10

Thread: Configuring QT Creator environment

  1. #1
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Configuring QT Creator environment

    Hi all,

    How do you configure QT Creator's environment (e.g. the environment variables used) in a similar way qtenv.bat does this for the QT command line?

    Do you know any articles on how to configure your system (environment variables and such) to run Creator, especially when you have other IDEs installed as well (Visual Studio 6 in my case)?

    The question is related to this thread, which describes my difficulties building a sample (starting on the command line, but later spilling over to Creator)

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

    Default Re: Configuring QT Creator environment

    You don't need to configure Creator through environment variables but if you want to, you can change the default version of Qt used by Creator by setting the path to qmake in PATH env variable.
    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.


  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring QT Creator environment

    On Windows you change environment variables by right clicking My Computer -> Properties -> Advanced -> Environment variables. You then need to restart any applications that you want note the change (assuming you start the app from the desktop). The most useful variable for when you don't use QtCreator is QTDIR in the user section. For Visual Studio use, it should be set before you launch the IDE.

  4. #4
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Configuring QT Creator environment

    I was not talking about how to set the environment variables in Windows, rather how I set them in Creator.
    Having multiple IDEs on the same system causes multiple conflicts, where executables of the same name but in different versions exist. I need to tell Creator, not my system, where to access the correct applications.
    For the QT command line, I do that using qtvars.bat. How do I do it for Creator?

    I know I can change the path in the project settings, but what I need are global settings.


    A second issue I discovered yesterday is that qmake crashes when started from Creator. When I try to emulate the same behaviour using QT command line (exact same call with same parameters), it either works (if I am in the folder where the .pro file is) or at worst tells me it can't find rcc.exe (when I am in the QT base folder).

    My current best guess is that Creator uses different paths, and therefore qmake uses different DLLs or EXEs, and crashes. To the best of my knowledge, I entered exactly the same path and other environment variables in "Build Environment" that I use in the QT command line, where qmake works just fine.
    Last edited by Asperamanca; 20th October 2009 at 09:39. Reason: typo

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

    Default Re: Configuring QT Creator environment

    Quote Originally Posted by fatjuicymole View Post
    On Windows you change environment variables by right clicking My Computer -> Properties -> Advanced -> Environment variables.
    This isn't entirely true you know... You can change environment variables from the command line and I think that's what the question was about.
    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.


  6. #6
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Configuring QT Creator environment

    Quote Originally Posted by wysota View Post
    This isn't entirely true you know... You can change environment variables from the command line and I think that's what the question was about.
    How do I get a command line in Creator (so I can configure the Creator environment)?

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

    Default Re: Configuring QT Creator environment

    You have to setup environment variables BEFORE you run Creator. Otherwise Creator won't pick them up - that's how environment variables work. So open the command prompt, set your vars and then call Creator from the same command line. You can make a copy of qtenv.bat and modify the contents (remember to call Creator at the end).
    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:

    Asperamanca (21st October 2009)

  9. #8
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Configuring QT Creator environment

    Quote Originally Posted by wysota View Post
    You have to setup environment variables BEFORE you run Creator. Otherwise Creator won't pick them up - that's how environment variables work. So open the command prompt, set your vars and then call Creator from the same command line. You can make a copy of qtenv.bat and modify the contents (remember to call Creator at the end).
    I have tried starting Creator from the QT command line before. I must have done something wrong then, because now it works!
    qmake still crashes when I use the "Clean Environment", but works just fine with the regular environment (I have removed the Include references to Visual Studio 6 paths, and that seems to do wonders).

    I'll now create my own bat file for starting Creator, as you suggested. THANKS!

  10. #9
    Join Date
    Oct 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Configuring QT Creator environment

    Quote Originally Posted by wysota View Post
    This isn't entirely true you know... You can change environment variables from the command line and I think that's what the question was about.
    It seemed a little daft to ask how to set environment variables from the command line when you already know how to set them from the command line by using qtenv.bat, hence my suggestion.

    Also, as you probably know, environment variables set from the command line are lost when the command line is closed. Environment variables set from the GUI are kept across system reboots.

    Quote Originally Posted by Asperamanca View Post
    I'll now create my own bat file for starting Creator, as you suggested. THANKS!
    If you set the variables in the GUI, there's no need for a bat file, and you can start Creator from the desktop rather than from the command prompt.

    I use Visual Studio 2008 with this configuration and I have no problems whatsoever - I just set QTDIR in the GUI environment variables page and everything works as it should.

  11. #10
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Configuring QT Creator environment

    Quote Originally Posted by Steven View Post
    If you set the variables in the GUI, there's no need for a bat file, and you can start Creator from the desktop rather than from the command prompt.
    I can't, because the global environment variables contain INCLUDEs that break QT. But I can just as well create a desktop link to my bat file - once I have that, there's really no difference to a "normal" link (except I have a command prompt open while running Creator - but I get that in 1.3.0 beta, anyway)

    Quote Originally Posted by Steven View Post
    I use Visual Studio 2008 with this configuration and I have no problems whatsoever - I just set QTDIR in the GUI environment variables page and everything works as it should.
    Visual Studio 6 is a different thing. I can't even blame it for having outdated header files.

Similar Threads

  1. Problem configuring qt for static linking.
    By Netich in forum Qt Programming
    Replies: 4
    Last Post: 12th October 2009, 00:55
  2. Windows Mobile 5 configuring faliure
    By zeldaknight in forum Newbie
    Replies: 10
    Last Post: 9th July 2009, 03:36
  3. Need help installing / configuring
    By TheSaw in forum Installation and Deployment
    Replies: 4
    Last Post: 6th April 2009, 05:05
  4. problems in configuring 'qvfb' for Qt/embedded
    By rishiraj in forum Installation and Deployment
    Replies: 0
    Last Post: 1st April 2009, 08:46
  5. Qt/Mac Configuring with libTiff ?
    By nareshqt in forum Installation and Deployment
    Replies: 0
    Last Post: 11th June 2008, 13:19

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.