title: Clang - "unable to execute command: program not executable"
body: <p>I'm trying to compile this code:</p>
  
  <pre><code>extern "C" void __declspec(dllexport)  TEST(int num)
  {
      return;
  }
  </code></pre>
  
  <p>With this command line:</p>
  
  <pre><code>clang++ main.cpp -shared -o test.dll
  </code></pre>
  
  <p>and clang is failing to (it appears, anyway) find the linker</p>
  
  <p>Verbose output from clang:</p>
  
  <blockquote>
    <p>"g++" -shared -v -c -m32 -o "C:\Users\Steve\AppData\Local\Temp\main-c7cf26.o" -x assembler "C:\Users\Steve\AppData\Local\Temp\main-5132f2.s"
     clang++.exe: error: unable to execute command: program not executable
     "g++" -shared -v -c -m32 -o "C:\Users\Steve\AppData\Local\Temp\TEST_CLANG-e037c5.o" -x assembler "C:\Users\Steve\Documents\A\codeblox\TEST_CLANG\TEST_CLANG.s"
     clang++.exe: error: unable to execute command: program not executable</p>
  </blockquote>
  
  <p>So it looks like clang is unable to find g++, but my PATH is set to:</p>
  
  <pre><code>C:\Program Files (x86)\LLVM\bin&gt;%PATH%
  '"C:\Program Files (x86)\CodeBlocks\MinGW\bin"'
  </code></pre>
  
  <p>So I'm not really understanding that the issue is here!</p>