title: Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment whithin gitlab env
body: <p>I've a strange phenomenom happening that I don't know how to investigate. 
  I hope someone already encountered this an can provide tips</p>
  
  <p>I'm using gitlab CI to build some Qt based projects.
  gitlab runner calls a script named build.sh that works just fine when I run it manually as "me" in my env dev.
  However runner raises an error stating "Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment".
  So I made sure g++ was available (g++ -version is OK) and in g++ is in PATH but pbm is still there.</p>
  
  <p>here is part of the script where the problem resides and the investigation I performed</p>
  
  <pre><code>echo "&gt;&gt;&gt;&gt;&gt;&gt; now generating makefiles for  ${PROJECT_FILE} &lt;&lt;&lt;&lt;&lt;&lt;"
  export QTDIR=/usr/lib64/qt5
  echo $QTDIR
  echo QMAKESPEC is
  qmake-qt5 -query QMAKE_SPEC
  echo gcc version is
  gcc --version
  g++ --version
  
  echo $PWD
  whoami
  $cmd_qMake -v
  $cmd_qMake -makefile -o qMakefile ../src/${PROJECT_FILE}
  
  echo PATH is $PATH
  echo QMAKESPEC is
  qmake-qt5 -query QMAKE_SPEC
  echo gcc version is
  gcc --version
  g++ --version
  
  </code></pre>
  
  <p>and here is the output (sorry; this is in debug mode)</p>
  
  <pre><code>&gt;&gt;&gt;&gt;&gt;&gt; now generating makefiles for  Communication.pro &lt;&lt;&lt;&lt;&lt;&lt;
  + export QTDIR=/usr/lib64/qt5
  + QTDIR=/usr/lib64/qt5
  + echo /usr/lib64/qt5
  /usr/lib64/qt5
  + echo QMAKESPEC is
  QMAKESPEC is
  + qmake-qt5 -query QMAKE_SPEC
  linux-g++
  + echo gcc version is
  gcc version is
  + gcc --version
  gcc (GCC) 7.3.0
  Copyright (C) 2017 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  + g++ --version
  g++ (GCC) 7.3.0
  Copyright (C) 2017 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  + echo /root/builds/3188cf72/0/EGNOS_V3/AIV-P/AIV-P/Shared/Communication/.buildchain
  /root/builds/3188cf72/0/EGNOS_V3/AIV-P/AIV-P/Shared/Communication/.buildchain
  + whoami
  root
  + qmake-qt5 -v
  QMake version 3.1
  Using Qt version 5.9.2 in /usr/lib64
  + qmake-qt5 -makefile -o qMakefile ../src/Communication.pro
  Project ERROR: Cannot run compiler 'g++'. Maybe you forgot to setup the environment?
  + echo PATH is /opt/gcc-7.3.0/bin:/usr/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/bin
  PATH is /opt/gcc-7.3.0/bin:/usr/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/bin
  + echo QMAKESPEC is
  QMAKESPEC is
  + qmake-qt5 -query QMAKE_SPEC
  linux-g++
  + echo gcc version is
  gcc version is
  + gcc --version
  gcc (GCC) 7.3.0
  Copyright (C) 2017 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  + g++ --version
  g++ (GCC) 7.3.0
  Copyright (C) 2017 Free Software Foundation, Inc.
  This is free software; see the source for copying conditions.  There is NO
  warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
  + for target in '"${TARGETS[@]}"'
  </code></pre>
  
  <p>As you can see, g++ seems available un runner's root PATH
  So why is qMake failing?</p>
  
  <p>Thanks for your help</p>
  
  <p>Zaluum</p>