title: Building Qt fro Source with MSYS2 / MinGW 64 - ICU headers not found
body: <p>I followed the instructions from <a href="https://wiki.qt.io/MinGW-64-bit" rel="nofollow noreferrer">MinGW-64-bit</a>, using Option A: build Qt in MSYS2-shell &amp; MinGW-w64 Win64 Shell.</p>
  
  <p>I downloaded the source code</p>
  
  <pre><code>git clone https://code.qt.io/qt/qt5.git
  cd qt5
  perl init-repository
  git checkout 5.8
  </code></pre>
  
  <p>After installing all prerequisites I build OpenSSL and ICU - installed in</p>
  
  <ul>
  <li>/usr/local/openssl</li>
  <li>/usr/local/icu</li>
  </ul>
  
  <p>But from there on the instructions are not so clear. It's stated to use a windows command shell to set some environment variables. But later I'm using the MSYS2 64 Bit shell, so these have no effect. Here is what I did:</p>
  
  <pre><code>export INCLUDE=/usr/local/icu/include:/usr/local/openssl/include
  export LIB=/usr/local/icu/lib:/usr/local/openssl/lib
  export QMAKESPEC=
  export QTDIR=
  windows2unix() { local pathPcs=() split pathTmp IFS=\;; read -ra split &lt;&lt;&lt; "$*"; for pathTmp in "${split[@],}"; do pathPcs+=( "/${pathTmp//+([:\\])//}" ); done; echo "${pathPcs[*]}"; }; systemrootP=$(windows2unix "$SYSTEMROOT"); export PATH="$PWD/qtbase/bin:$PWD/gnuwin32/bin:/c/msys64/mingw64/bin:/c/msys64/usr/bin:/c/msys64/usr/local/icu/lib"
  export MAKE_COMMAND=
  
  mkdir qt-build
  cd qt-build
  
  ../qt5/configure -prefix /opt/qt -debug-and-release -opensource -confirm-license -platform win32-g++ -developer-build -icu -I /usr/local/icu/include -opengl desktop -openssl -plugin-sql-odbc -nomake examples -nomake tests
  </code></pre>
  
  <p>The configure script stops with the following error:</p>
  
  <pre><code>ERROR: Feature 'icu' was enabled, but the pre-condition 'libs.icu' failed.
  </code></pre>
  
  <p>In Qt's config.log I found:</p>
  
  <pre><code>looking for library icu
  Trying source 0 (type inline) of library icu ...
   =&gt; source failed condition 'config.win32 &amp;&amp; !features.shared'.
  Trying source 1 (type inline) of library icu ...
  + cd C:\msys64\home\asp\qt-build\qtbase\config.tests\unix\icu &amp;&amp; C:\msys64\home\asp\qt-build\qtbase\bin\qmake.exe "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "LIBS += -licuin -licuuc -licudt" C:/msys64/home/asp/qt5/qtbase/config.tests/unix/icu
  + cd C:\msys64\home\asp\qt-build\qtbase\config.tests\unix\icu &amp;&amp; set MAKEFLAGS=&amp; C:/msys64/usr/bin/make
  &gt; g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -IC:/msys64/home/asp/qt5/qtbase/config.tests/unix/icu -I. -IC:/msys64/home/asp/qt5/qtbase/mkspecs/win32-g++  -o icu.o C:/msys64/home/asp/qt5/qtbase/config.tests/unix/icu/icu.cpp
  &gt; C:/msys64/home/asp/qt5/qtbase/config.tests/unix/icu/icu.cpp:40:28: fatal error: unicode/utypes.h: No such file or directory
  &gt;  #include &lt;unicode/utypes.h&gt;
  &gt;                             ^
  &gt; compilation terminated.
  &gt; make: *** [Makefile:155: icu.o] Fehler 1
   =&gt; source failed verification.
  Trying source 2 (type inline) of library icu ...
   =&gt; source failed condition '!config.win32'.
  test config.corelib.libraries.icu FAILED
  </code></pre>
  
  <p>Why doesn't the script find the includes? I set them as</p>
  
  <ul>
  <li>parameter '-I /usr/local/icu/include'</li>
  <li>export INCLUDE=/usr/local/icu/include:/usr/local/openssl/include</li>
  </ul>
  
  <p>I also tried</p>
  
  <ul>
  <li>parameter '-I /C/msys64/usr/local/icu/include'</li>
  <li>export INCLUDE=/C/msys64/usr/local/icu/include:/C/msys64/usr/local/openssl/include</li>
  </ul>
  
  <p>Is there another possibility to give the correct INCLUDE path to the compiler?</p>