Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Add-in VS2008 project with MSbuild fails to set QTDIR
Forum Updated to NodeBB v4.3 + New Features

Qt Add-in VS2008 project with MSbuild fails to set QTDIR

Scheduled Pinned Locked Moved Qt Creator and other tools
8 Posts 2 Posters 9.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    deweirdt
    wrote on last edited by
    #1

    Hi,

    We have been migrating to TFS and now we have encoutered a problem. Let me first explain how the development setup is.
    Each developer is working in VS2008 (required since we are developing on a WinCE platform). The solution is cross-platfrom for Win32 and WinCE. On the developer machine everything is running perfectly.
    Even when we try it with the command line (Qt add-in is supporting console) then everyting is building fine. So we can assume that the QTDIR is set correctly by the Qt add-in. The command to build on the development machine is 'devenv'.

    Now since TFS is using Msbuild we have encountered the probem that the QTDIR variable is not set by the Qt add-in. I'm not sure if it has something to do with VS2010 since when we try it on the development machine (VS2008) with msbuild then it's also failing.
    From the logging from msbuild I guess that the QTDIR is not set, but please correct me if I'm wrong

    This is the output from msbuild:
    Microsoft (R) Build Engine Version 3.5.30729.5420
    [Microsoft .NET Framework, Version 2.0.50727.5448]
    Copyright (C) Microsoft Corporation 2007. All rights reserved.

    Using solution cache file "c:\Temp\TestQT\Sky.App\Source\SkyApp.sln.cache" for configuration "Debug|Win32" and tools version "3.5".
    Build started 29/02/2012 17:33:57.
    Project "c:\Temp\TestQT\Sky.App\Source\SkyApp.sln" on node 0 (Rebuild target(s)).
    Initial Properties:
    MSBuildToolsVersion = 3.5
    PSModulePath = C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    PUBLIC = C:\Users\Public
    SESSIONNAME = Console
    SolutionDir = c:\Temp\TestQT\Sky.App\Source
    SolutionExt = .sln
    SolutionFileName = SkyApp.sln
    SolutionName = SkyApp
    SolutionPath = c:\Temp\TestQT\Sky.App\Source\SkyApp.sln
    SystemDrive = C:
    SystemRoot = C:\Windows
    TargetFrameworkVersion = v3.5
    TEMP = C:\Users\PETERJ~1\AppData\Local\Temp
    TFSPowerToolDir = C:\Program Files (x86)\Microsoft Team Foundation Server 2010 Power Tools
    TMP = C:\Users\PETERJ~1\AppData\Local\Temp
    USERDNSDOMAIN = CORP.TRANSICS.COM
    USERDOMAIN = TRANSICSNV
    USERNAME = peterjand
    USERPROFILE = C:\Users\peterjand
    VBOX_INSTALL_PATH = C:\Program Files\Oracle\VirtualBox
    VCINSTALLDIR = c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC
    VS100COMNTOOLS = c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools
    VS90COMNTOOLS = c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools
    VSINSTALLDIR = c:\Program Files (x86)\Microsoft Visual Studio 9.0
    windir = C:\Windows
    WindowsSdkDir = C:\Program Files\Microsoft SDKs\Windows\v6.0A\

    Initial Items:
    _SolutionProjectProjects
    UI_TxMax\UI_TxMax.vcproj

    Building with tools version "3.5".
    Target "ValidateSolutionConfiguration: (TargetId:0)" in file "c:\Temp\TestQT\Sky.App\Source\SkyApp.sln.cache" from project "c:\Temp\TestQT\Sky.App\Source\SkyApp.sln":
    Locating vcbuild.exe: found at "c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE....\vc\vcpackages\vcbuild.exe". (TaskId:10)
    Command: (TaskId:10)
    c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE....\vc\vcpackages\vcbuild.exe /rebuild c:\Temp\TestQT\Sky.App\Source\UI_TxMax\UI_TxMax.vcproj "Debug|Win32" (TaskId:10)
    The "VCBuild" task is using "VCBuild.exe" from "c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE....\vc\vcpackages\vcbuild.exe". (TaskId:10)
    Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.21022 (TaskId:10)
    Copyright (C) Microsoft Corporation. All rights reserved. (TaskId:10)
    (TaskId:10)
    Rebuild started: Project: UI_TxMax, Configuration: Debug|Win32 (TaskId:10)
    Deleting intermediate and output files for project 'UI_TxMax', configuration 'Debug|Win32' (TaskId:10)
    Moc'ing topstatusbarwidget.h... (TaskId:10)
    The system cannot find the path specified. (TaskId:10)
    Project : error PRJ0019: A tool returned an error code from "Moc'ing topstatusbarwidget.h..."
    Project : warning PRJ0018: The following environment variables were not found:
    $(QTDIR) (TaskId:10)
    Build log was saved at "file://c:\Temp\TestQT\Sky.App\Source\UI_TxMax\Win32\Debug\BuildLog.htm" (TaskId:10)
    UI_TxMax - 1 error(s), 0 warning(s) (TaskId:10)
    The command exited with code 1. (TaskId:10)

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      welcome to devnet

      I am not sure but I would assume that vsaddin is setting QTDIR only for the environment of msvc.
      Where or how are you starting msbuild?
      Do you start it from inside of visual studio or outside?

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        deweirdt
        wrote on last edited by
        #3

        Hi,

        Both of them (devenv and msbuild) are started from the command prompt from visual studio. I did not went through the UI to go to the console I went from the shortcut provided in the 'start menu'.

        Both command prompts should have been the same.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          [quote author="deweirdt" date="1330538425"]Hi,
          Both of them (devenv and msbuild) are started from the command prompt from visual studio. I did not went through the UI to go to the console I went from the shortcut provided in the 'start menu'.
          [/quote]
          I assume you mean with 'start menu' the part started probably on the left upper corner in vs 2008/2010. I have just vs 2005, so that is a bit different.
          I have started the command prompt through vs2005 via 'tools'->'Visual Studio Command Prompt'. the command "set qt" shows among other settings starting with qt also QTDIR. I do not see QTDIR when using the standard command prompt.

          i guess you should file a bug report then on "JIRA":https://bugreports.qt-project.org/secure/Dashboard.jspa
          Please put a link here to your filing.

          As a solution you can introduce the QTDIR in your system environment. I am not sure what that means for your compilations for wince. I am using two different settings. QTDIR for desktop and QTDIRCE for wince compilations. The drawback is that you may have to change all settings in the wince portion.

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • D Offline
            D Offline
            deweirdt
            wrote on last edited by
            #5

            Hi,

            No I did not went through the visual studio itself. When I've installed VS then the installer created a shortcut in the startmenu (from windows) to go directly to the console.

            I cannot use the enviroment variable QTDIRCE and another since when creating a common project then you'll have to manually change the QTDIR command to QTDIRCE. We have done this in the past and this is resulting into many time changing the project files before resulting into a good build.

            I've created an bug report. You can find it at https://bugreports.qt-project.org/browse/QTVSADDINBUG-115

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #6

              i have found also the "visual studio 2005 command prompt" link. It has been introduced by the vs installer as well. However, when starting there it does not show QTDIR in the environment either.
              I think you have to go through the IDE and start the command from there. In that case vsaddin is started as well. This makes sure that the environment is updated as you need.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • D Offline
                D Offline
                deweirdt
                wrote on last edited by
                #7

                Well not completely true, the Qt add-in you can configure (add-in manager) to work with the command line. This means when you then call devenv that QTDIR will be set by the Qt add-in (which is perfectly). However when you do the same with msbuild then this is not working.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  koahnig
                  wrote on last edited by
                  #8

                  ok, outside of my experience. But thanks for sharing, I have learnt a bit more :-)

                  Vote the answer(s) that helped you to solve your issue(s)

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved