title: C compiler not found, but GCC is installed
body: <p>I have a fresh install of a Slackware64 14.0 on a dedicate server and I'm having a hard time to compile nginx.</p>
  
  <pre><code>./configure (my options)
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>checking for OS
   + Linux 3.10.23-xxxx-std-ipv6-64 x86_64
  checking for C compiler ... not found
  
  ./configure: error: C compiler cc is not found
  </code></pre>
  
  <p>but gcc is installed, as this is what <code>gcc -v</code> returns:</p>
  
  <pre><code>Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/4.7.1/specs
  COLLECT_GCC=gcc
  COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/4.7.1/lto-wrapper
  Target: x86_64-slackware-linux
  Configured with: ../gcc-4.7.1/configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap --enable-languages=ada,c,c++,fortran,go,java,lto,objc --enable-threads=posix --enable-checking=release --enable-objc-gc --with-system-zlib --with-python-dir=/lib64/python2.7/site-packages --disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp --enable-lto --with-gnu-ld --verbose --enable-java-home --with-java-home=/usr/lib64/jvm/jre --with-jvm-root-dir=/usr/lib64/jvm --with-jvm-jar-dir=/usr/lib64/jvm/jvm-exports --with-arch-directory=amd64 --with-antlr-jar=/home/slackware/slackbuilds/gcc/antlr-runtime-3.4.jar --enable-multilib --target=x86_64-slackware-linux --build=x86_64-slackware-linux --host=x86_64-slackware-linux
  Thread model: posix
  gcc version 4.7.1 (GCC) 
  </code></pre>
  
  <p><strong>What I tried</strong> (after googling)</p>
  
  <p>"<em><code>/tmp</code> is mounted with <code>noexec</code>.</em>"<br>
  Indeed it was, as part of my hardening configurations. I changed it and reboot to make sure, now my <code>/etc/fstab</code> looks like this:</p>
  
  <pre><code># &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;   &lt;dump&gt;  &lt;pass&gt;
  /dev/md1    /   ext4    errors=remount-ro,discard   0   1
  /dev/md2    /home   ext4    defaults,discard    1   2
  /dev/md5    /var/www    ext4    defaults,discard    1   2
  /dev/md6    /var/log    ext4    defaults,discard    1   2
  /dev/md7    /tmp    ext4    defaults,discard,nodev,nosuid   1   2
  /dev/md8    /var/lib/mysql  ext4    defaults,discard    1   2
  /dev/sda3   swap    swap    defaults    0   0
  /dev/sdb3   swap    swap    defaults    0   0
  proc            /proc   proc    defaults        0       0
  sysfs           /sys    sysfs   defaults        0       0
  /tmp            /var/tmp none   rw,nosuid,nodev,bind    0   0
  </code></pre>
  
  <p>The new fstab without noexec does not work though. (I even tried with explicit <code>exec</code>)</p>
  
  <p>"<em>gcc is not on your <code>$PATH</code></em>"<br>
  It is.</p>
  
  <pre><code>whereis gcc
  gcc: /usr/bin/gcc /usr/lib64/gcc /usr/X11R6/bin/gcc /usr/bin/X11/gcc /usr/X11/bin/gcc /usr/libexec/gcc /usr/man/man1/gcc.1.gz /usr/share/man/man1/gcc.1.gz /usr/X11/man/man1/gcc.1.gz
  
  echo $PATH
  /usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
  </code></pre>
  
  <p><strong>Other things I did:</strong></p>
  
  <p>Looking nginx configure file, they make use of a CC var. This CC did not exist.</p>
  
  <pre><code>CC=/usr/bin/gcc
  </code></pre>
  
  <p>This did not work too.</p>
  
  <p>I tried compiling another program from source to make sure this is not nginx problem, and I found something interesting maybe:</p>
  
  <p>By trying to compile <code>htop</code>, I got this:</p>
  
  <pre><code>./configure 
  
  checking for gcc... gcc
  checking whether the C compiler works... no
  configure: error: in `/home/napster/htop-master':
  configure: error: C compiler cannot create executables
  See `config.log' for more details
  </code></pre>
  
  <p>Which is expected, because even though I have a minimal installation without most deveveloper tools, the gcc is found. This error should be solved by installing the required tool.</p>
  
  <p>I even checked symbolic links on <code>/usr/bin</code> to make sure gcc and cc are ok:</p>
  
  <pre><code>ls -l /usr/bin
  
  cc -&gt; gcc
  gcc -&gt; gcc-4.7.1
  </code></pre>
  
  <p>Any ideas?<br>
  Thanks in advance.</p>