Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-44184

Visual Studio 2010 RC fails for DEFINES with space

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6
    • 4.8.6, 5.4.0
    • Build tools: qmake
    • None
    • Windows 7 SP1, Visual Studio 2010 SP1, Qt 4.8.6
    • d83bd9c6f5abd936b853029bf7030ebb4792f9fb

    Description

      When defining a variable for the pre-pocessor via qmakes:

      DEFINES += FOO=BAR BAR

      the vcxproj generator for Visual Studio 2010 fails to generate a valid project file:
      the RC compiler fails.

      I tried different syntaxes to have the project file for VS2010 valid, but everything I tried failed:

      # DEFINES += FOO=BAR BAR     ### (1) compiles but delivers 1 in main.cpp instead of "BAR BAR"
      # DEFINES += FOO="BAR BAR"   ### (2) moc does not work, CC1x Fails with undefined BAR 
      # DEFINES += FOO='BAR BAR'   ### (3) moc does not work, CC1x Fails with undefined BAR
      # DEFINES += 'FOO="BAR BAR"' ### (4) RC fails
      # DEFINES += "FOO=BAR BAR"   ### (5) moc does not work, CC1x Fails with undefined FOO
      DEFINES += "FOO=\"BAR BAR\"" ### (6) RC fails  ( FOO seems to be replaced as "BAR BAR" in main.cpp, at least intellisense says so...)
      

      It seems to sum up, that RC and CC need different syntax in the <PreprocessorDefinitions> under <ClCompile> and <ResourceCompile>
      If you take aternative (6) with "just" RC failing and change inside the

      <ResourceCompile> <PreprocessorDefinitions> FOO=&quot;BAR BAR&quot;

      to

      "FOO=BAR BAR"

      then RC compiles !!!
      However I did not check, if using FOO inside the RC file works in this case....

      I attached the pro file which was modified from a normal widget app wizard generated project.

      Attachments

        1. test1.pro
          2 kB
        2. test1.zip
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            moellney Michael Möllney
            moellney Michael Möllney
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes