title: Cant build simple QT5 project
body: <p>I setup QT for windows using this tutorial - <a href="https://wiki.qt.io/MinGW-64-bit" rel="nofollow noreferrer">https://wiki.qt.io/MinGW-64-bit</a></p>
  
  <p>I need to use CMAKE</p>
  
  <p>I create empty project in qtcreator, but when i try cmake it i get this errors:</p>
  
  <pre><code>Starting to parse CMake project, using: "-DCMAKE_BUILD_TYPE:STRING=Debug", "-DCMAKE_CXX_COMPILER:STRING=C:/msys64/mingw64/bin/g++.exe", "-DCMAKE_CXX_COMPILER_TARGET :STRING=x86_64-pc-msys", "-DCMAKE_C_COMPILER:STRING=C:/msys64/mingw64/bin/gcc.exe", "-DCMAKE_C_COMPILER_TARGET:STRING=x86_64-pc-msys", "-DCMAKE_PREFIX_PATH:STRING=C:/msys64/mingw64", "-DCMAKE_SYSROOT:STRING=C:/msys64", "-DQT_QMAKE_EXECUTABLE:STRING=C:/msys64/mingw64/bin/qmake.exe".
  The CXX compiler identification is GNU 9.2.0
  Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe
  Check for working CXX compiler: C:/msys64/mingw64/bin/g++.exe -- broken
  CMake Error at C:/msys64/mingw64/share/cmake-3.15/Modules/CMakeTestCXXCompiler.cmake:53 (message):
    The C++ compiler
  
      "C:/msys64/mingw64/bin/g++.exe"
  
    is not able to compile a simple test program.
  
    It fails with the following output:
  
      Change Dir: C:/Users/xxx/AppData/Local/Temp/QtCreator-RwlXKb/qtc-cmake-tQFVtoZK/CMakeFiles/CMakeTmp
  
      Run Build Command(s):C:/msys64/usr/bin/ninja.exe cmTC_373cd &amp;&amp; [1/2] Building CXX object CMakeFiles/cmTC_373cd.dir/testCXXCompiler.cxx.obj
      FAILED: CMakeFiles/cmTC_373cd.dir/testCXXCompiler.cxx.obj 
      C:\msys64\mingw64\bin\g++.exe --sysroot=C:/msys64     -o CMakeFiles/cmTC_373cd.dir/testCXXCompiler.cxx.obj -c testCXXCompiler.cxx
      /bin/sh: C:msys64mingw64bing++.exe: command not found
      ninja: build stopped: subcommand failed.
  
  
  
  
  
    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    CMakeLists.txt:3 (project)
  
  
  Configuring incomplete, errors occurred!
  See also "C:/Users/xxx/AppData/Local/Temp/QtCreator-RwlXKb/qtc-cmake-tQFVtoZK/CMakeFiles/CMakeOutput.log".
  See also "C:/Users/xxx/AppData/Local/Temp/QtCreator-RwlXKb/qtc-cmake-tQFVtoZK/CMakeFiles/CMakeError.log".
  CMake Deprecation Warning:
    The 'cmake-server(7)' is deprecated.  Please port clients to use the
    'cmake-file-api(7)' instead.
  
  
  CMake Project parsing failed.
  </code></pre>
  
  <p>It seems error in this string:</p>
  
  <pre><code> C:msys64mingw64bing++.exe
  </code></pre>
  
  <p>It because slashes not handled correctly.</p>
  
  <p>So how i fix it? Where there setings stored?</p>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>Here is my CMakeLists.txt </p>
  
  <pre><code>cmake_minimum_required(VERSION 3.5)
  
  project(t2 LANGUAGES CXX)
  
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
  
  set(CMAKE_AUTOUIC ON)
  set(CMAKE_AUTOMOC ON)
  set(CMAKE_AUTORCC ON)
  
  set(CMAKE_CXX_STANDARD 11)
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
  
  find_package(Qt5 COMPONENTS Core Quick REQUIRED)
  
  if(ANDROID)
      add_library(t2 SHARED main.cpp qml.qrc)
  else()
      add_executable(t2 main.cpp qml.qrc)
  endif()
  
  target_compile_definitions(t2
    PRIVATE $&lt;$&lt;OR:$&lt;CONFIG:Debug&gt;,$&lt;CONFIG:RelWithDebInfo&gt;&gt;:QT_QML_DEBUG&gt;)
  target_link_libraries(t2
    PRIVATE Qt5::Core Qt5::Quick)
  
  # QtCreator supports the following variables for Android, which are identical to qmake Android variables.
  # Check http://doc.qt.io/qt-5/deployment-android.html for more information.
  # These variables must use CACHE, otherwise QtCreator won't see them.
  
  #if(ANDROID)
  #    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android" CACHE INTERNAL "")
  #    if (ANDROID_ABI STREQUAL "armeabi-v7a")
  #        set(ANDROID_EXTRA_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so CACHE INTERNAL "")
  #    endif()
  #endif()
  </code></pre>
  
  <p>I try and launch <code>cmake CMakeLists.txt</code> and it crete makefile</p>
  
  <pre><code># CMAKE generated file: DO NOT EDIT!
  # Generated by "Unix Makefiles" Generator, CMake Version 3.15
  
  # Default target executed when no arguments are given to make.
  default_target: all
  
  .PHONY : default_target
  
  # Allow only one "make -f Makefile2" at a time, but pass parallelism.
  .NOTPARALLEL:
  
  
  #=============================================================================
  # Special targets provided by cmake.
  
  # Disable implicit rules so canonical targets will work.
  .SUFFIXES:
  
  
  # Remove some rules from gmake that .SUFFIXES does not remove.
  SUFFIXES =
  
  .SUFFIXES: .hpux_make_needs_suffix_list
  
  
  # Suppress display of executed commands.
  $(VERBOSE).SILENT:
  
  
  # A target that is always out of date.
  cmake_force:
  
  .PHONY : cmake_force
  
  #=============================================================================
  # Set environment variables for the build.
  
  # The shell in which to execute make rules.
  SHELL = /bin/sh
  
  # The CMake executable.
  CMAKE_COMMAND = /usr/bin/cmake.exe
  
  # The command to remove a file.
  RM = /usr/bin/cmake.exe -E remove -f
  
  # Escaping for special characters.
  EQUALS = =
  
  # The top-level source directory on which CMake was run.
  CMAKE_SOURCE_DIR = /c/projects/t2
  
  # The top-level build directory on which CMake was run.
  CMAKE_BINARY_DIR = /c/projects/t2
  
  #=============================================================================
  # Targets provided globally by CMake.
  
  # Special rule for the target rebuild_cache
  rebuild_cache:
      @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
      /usr/bin/cmake.exe -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
  .PHONY : rebuild_cache
  
  # Special rule for the target rebuild_cache
  rebuild_cache/fast: rebuild_cache
  
  .PHONY : rebuild_cache/fast
  
  # Special rule for the target edit_cache
  edit_cache:
      @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
      /usr/bin/ccmake.exe -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
  .PHONY : edit_cache
  
  # Special rule for the target edit_cache
  edit_cache/fast: edit_cache
  
  .PHONY : edit_cache/fast
  
  # The main all target
  all: cmake_check_build_system
      $(CMAKE_COMMAND) -E cmake_progress_start /c/projects/t2/CMakeFiles /c/projects/t2/CMakeFiles/progress.marks
      $(MAKE) -f CMakeFiles/Makefile2 all
      $(CMAKE_COMMAND) -E cmake_progress_start /c/projects/t2/CMakeFiles 0
  .PHONY : all
  
  # The main clean target
  clean:
      $(MAKE) -f CMakeFiles/Makefile2 clean
  .PHONY : clean
  
  # The main clean target
  clean/fast: clean
  
  .PHONY : clean/fast
  
  # Prepare targets for installation.
  preinstall: all
      $(MAKE) -f CMakeFiles/Makefile2 preinstall
  .PHONY : preinstall
  
  # Prepare targets for installation.
  preinstall/fast:
      $(MAKE) -f CMakeFiles/Makefile2 preinstall
  .PHONY : preinstall/fast
  
  # clear depends
  depend:
      $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
  .PHONY : depend
  
  #=============================================================================
  # Target rules for targets named t2
  
  # Build rule for target.
  t2: cmake_check_build_system
      $(MAKE) -f CMakeFiles/Makefile2 t2
  .PHONY : t2
  
  # fast build rule for target.
  t2/fast:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/build
  .PHONY : t2/fast
  
  #=============================================================================
  # Target rules for targets named t2_autogen
  
  # Build rule for target.
  t2_autogen: cmake_check_build_system
      $(MAKE) -f CMakeFiles/Makefile2 t2_autogen
  .PHONY : t2_autogen
  
  # fast build rule for target.
  t2_autogen/fast:
      $(MAKE) -f CMakeFiles/t2_autogen.dir/build.make CMakeFiles/t2_autogen.dir/build
  .PHONY : t2_autogen/fast
  
  main.o: main.cpp.o
  
  .PHONY : main.o
  
  # target to build an object file
  main.cpp.o:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/main.cpp.o
  .PHONY : main.cpp.o
  
  main.i: main.cpp.i
  
  .PHONY : main.i
  
  # target to preprocess a source file
  main.cpp.i:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/main.cpp.i
  .PHONY : main.cpp.i
  
  main.s: main.cpp.s
  
  .PHONY : main.s
  
  # target to generate assembly for a file
  main.cpp.s:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/main.cpp.s
  .PHONY : main.cpp.s
  
  t2_autogen/EWIEGA46WW/qrc_qml.o: t2_autogen/EWIEGA46WW/qrc_qml.cpp.o
  
  .PHONY : t2_autogen/EWIEGA46WW/qrc_qml.o
  
  # target to build an object file
  t2_autogen/EWIEGA46WW/qrc_qml.cpp.o:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/t2_autogen/EWIEGA46WW/qrc_qml.cpp.o
  .PHONY : t2_autogen/EWIEGA46WW/qrc_qml.cpp.o
  
  t2_autogen/EWIEGA46WW/qrc_qml.i: t2_autogen/EWIEGA46WW/qrc_qml.cpp.i
  
  .PHONY : t2_autogen/EWIEGA46WW/qrc_qml.i
  
  # target to preprocess a source file
  t2_autogen/EWIEGA46WW/qrc_qml.cpp.i:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/t2_autogen/EWIEGA46WW/qrc_qml.cpp.i
  .PHONY : t2_autogen/EWIEGA46WW/qrc_qml.cpp.i
  
  t2_autogen/EWIEGA46WW/qrc_qml.s: t2_autogen/EWIEGA46WW/qrc_qml.cpp.s
  
  .PHONY : t2_autogen/EWIEGA46WW/qrc_qml.s
  
  # target to generate assembly for a file
  t2_autogen/EWIEGA46WW/qrc_qml.cpp.s:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/t2_autogen/EWIEGA46WW/qrc_qml.cpp.s
  .PHONY : t2_autogen/EWIEGA46WW/qrc_qml.cpp.s
  
  t2_autogen/mocs_compilation.o: t2_autogen/mocs_compilation.cpp.o
  
  .PHONY : t2_autogen/mocs_compilation.o
  
  # target to build an object file
  t2_autogen/mocs_compilation.cpp.o:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/t2_autogen/mocs_compilation.cpp.o
  .PHONY : t2_autogen/mocs_compilation.cpp.o
  
  t2_autogen/mocs_compilation.i: t2_autogen/mocs_compilation.cpp.i
  
  .PHONY : t2_autogen/mocs_compilation.i
  
  # target to preprocess a source file
  t2_autogen/mocs_compilation.cpp.i:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/t2_autogen/mocs_compilation.cpp.i
  .PHONY : t2_autogen/mocs_compilation.cpp.i
  
  t2_autogen/mocs_compilation.s: t2_autogen/mocs_compilation.cpp.s
  
  .PHONY : t2_autogen/mocs_compilation.s
  
  # target to generate assembly for a file
  t2_autogen/mocs_compilation.cpp.s:
      $(MAKE) -f CMakeFiles/t2.dir/build.make CMakeFiles/t2.dir/t2_autogen/mocs_compilation.cpp.s
  .PHONY : t2_autogen/mocs_compilation.cpp.s
  
  # Help Target
  help:
      @echo "The following are some of the valid targets for this Makefile:"
      @echo "... all (the default if no target is provided)"
      @echo "... clean"
      @echo "... depend"
      @echo "... rebuild_cache"
      @echo "... t2"
      @echo "... edit_cache"
      @echo "... t2_autogen"
      @echo "... main.o"
      @echo "... main.i"
      @echo "... main.s"
      @echo "... t2_autogen/EWIEGA46WW/qrc_qml.o"
      @echo "... t2_autogen/EWIEGA46WW/qrc_qml.i"
      @echo "... t2_autogen/EWIEGA46WW/qrc_qml.s"
      @echo "... t2_autogen/mocs_compilation.o"
      @echo "... t2_autogen/mocs_compilation.i"
      @echo "... t2_autogen/mocs_compilation.s"
  .PHONY : help
  
  
  
  #=============================================================================
  # Special targets to cleanup operation of make.
  
  # Special rule to run CMake to check the build system integrity.
  # No rule that depends on this can have commands that come from listfiles
  # because they might be regenerated.
  cmake_check_build_system:
      $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
  .PHONY : cmake_check_build_system
  </code></pre>
  
  <p>when i try to build it with <code>make</code>i get</p>
  
  <pre><code>C:\projects\t2&gt;make
  [ 16%] Automatic MOC and UIC for target t2
  [ 16%] Built target t2_autogen
  [ 33%] Automatic RCC for qml.qrc
  Scanning dependencies of target t2
  [ 50%] Building CXX object CMakeFiles/t2.dir/t2_autogen/mocs_compilation.cpp.o
  [ 66%] Building CXX object CMakeFiles/t2.dir/main.cpp.o
  [ 83%] Building CXX object CMakeFiles/t2.dir/t2_autogen/EWIEGA46WW/qrc_qml.cpp.o                                                                                                                                   
  [100%] Linking CXX executable t2.exe
  CMakeFiles/t2.dir/main.cpp.o:main.cpp:
  (.text$_ZN15QTypedArrayDataItE10deallocateEP10QArrayData[_ZN15QTypedArrayDataItE10deallocateEP10QArrayData]+0x1c): undefined reference to `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'
  CMakeFiles/t2.dir/main.cpp.o:main.cpp:(.text$_ZN15QTypedArrayDataItE10deallocateEP10QArrayData[_ZN15QTypedArrayDataItE10deallocateEP10QArrayData]+0x1c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `QArrayData::deallocate(QArrayData*, unsigned long, unsigned long)'            
  collect2: error: ld returned 1 exit status    
  make[2]: *** [CMakeFiles/t2.dir/build.make:126: t2.exe] Error 1   
  make[1]: *** [CMakeFiles/Makefile2:77: CMakeFiles/t2.dir/all] Error 2   
  make: *** [Makefile:84: all] Error 2 
  </code></pre>
  
  <p>Here source code of program:</p>
  
  <pre><code>#include &lt;QGuiApplication&gt;
  #include &lt;QQmlApplicationEngine&gt;
  
  int main(int argc, char *argv[])
  {
      QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  
      QGuiApplication app(argc, argv);
  
      QQmlApplicationEngine engine;
      const QUrl url(QStringLiteral("qrc:/main.qml"));
      QObject::connect(&amp;engine, &amp;QQmlApplicationEngine::objectCreated,
                       &amp;app, [url](QObject *obj, const QUrl &amp;objUrl) {
          if (!obj &amp;&amp; url == objUrl)
              QCoreApplication::exit(-1);
      }, Qt::QueuedConnection);
      engine.load(url);
  
      return app.exec();
  }
  </code></pre>