Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20047

Qt Unit Test build error if the project path contains spaces

    XMLWordPrintable

Details

    • e7f611cc67503d00ee27ceb7f2f5c50035122cd1

    Description

      To reproduce this bug:

      1. Create new Qt Unit Test project:

      File -> New File or Project... -> Other project -> Qt Unit Test

      2. Name the project simple_test and select path that contains spaces, for example:

      C:\Users\Administrator\Documents\Qt Projects

      3. Next -> Next -> ... -> Finish

      4. Now build the project. The following error occurs:

      D:\Programy\Qt\5.9.4\msvc2015\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DQT_DEPRECATED_WARNINGS -DSRCDIR=\"C:/Users/Administrator/Documents/Qt Projects/simple_test/\" -DQT_QML_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR="\"C:/Users/Administrator/Documents/Qt Projects/build-simple_test-Desktop_Qt_5_9_4_MSVC2015_32bit-Debug\"" --compiler-flavor=msvc --include debug/moc_predefs.h -ID:/Programy/Qt/5.9.4/msvc2015/mkspecs/win32-msvc -I"C:/Users/Administrator/Documents/Qt Projects/simple_test" -ID:/Programy/Qt/5.9.4/msvc2015/include -ID:/Programy/Qt/5.9.4/msvc2015/include/QtTest -ID:/Programy/Qt/5.9.4/msvc2015/include/QtCore -I. -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" -I"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" -I"C:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\\shared" -I"C:\Program Files (x86)\Windows Kits\8.1\include\\um" -I"C:\Program Files (x86)\Windows Kits\8.1\include\\winrt" ..\simple_test\tst_simple_testtest.cpp -o debug\tst_simple_testtest.moc
      
      moc: Too many input files specified: 'Projects/simple_test/"' '..\simple_test\tst_simple_testtest.cpp'
      
      jom: C:\Users\Administrator\Documents\Qt Projects\build-simple_test-Desktop_Qt_5_9_4_MSVC2015_32bit-Debug\Makefile.Debug [debug\tst_simple_testtest.moc] Error 1
      
      jom: C:\Users\Administrator\Documents\Qt Projects\build-simple_test-Desktop_Qt_5_9_4_MSVC2015_32bit-Debug\Makefile [debug] Error 2
      
      17:33:20: The process "D:\Programy\Qt\Tools\QtCreator\bin\jom.exe" exited with code 2.
      
      Error while building/deploying project simple_test (kit: Desktop Qt 5.9.4 MSVC2015 32bit)
      
      When executing step "Make"

      5. Now comment out the following line in simple_test.pro:

      DEFINES += SRCDIR=\\\"$$PWD/\\\"

      The project will build successfully.

       

      Attachments

        Activity

          People

            hunger Tobias Hunger
            amiart Robert Szefner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: