title: OpenCL not finding platforms?
body: <p>I am trying to utilize the C++ API for OpenCL.  I have installed my NVIDIA drivers and I have tested that I can run the simple vector addition program provided <a href="http://www.thebigblob.com/getting-started-with-opencl-and-gpu-computing/" rel="nofollow">here</a>.  I can compile this program with following gcc call and the program runs without problem.</p>
  
  <pre><code>gcc main.c -o vectorAddition -l OpenCL -I/usr/local/cuda-6.5/include
  </code></pre>
  
  <p>However, I would very much prefer to use the C++ API as opposed the very verbose host files needed for C.</p>
  
  <p>I downloaded the C++ bindings from Khronos from <a href="https://www.khronos.org/registry/cl/api/1.1/cl.hpp" rel="nofollow">here</a> and placed the <code>cl.hpp</code> file in the same location as my other <code>cl.h</code> file.  The code uses some C++11 so I can compile the code with:</p>
  
  <pre><code>g++ main.cpp -o vectorAddition_cpp -std=c++11 -l OpenCL -I/usr/local/cuda-6.5/include
  </code></pre>
  
  <p>but when I try to run the program I get the error:</p>
  
  <pre><code>clGetPlatformIDs(-1001)
  </code></pre>
  
  <p>I also tried the example provided <a href="http://simpleopencl.blogspot.com/2013/06/tutorial-simple-start-with-opencl-and-c.html" rel="nofollow">here</a> as well which gave a more helpful error message.</p>
  
  <pre><code>No platforms found. Check OpenCL installation!
  </code></pre>
  
  <p>The particular code which provides this error is this:</p>
  
  <pre><code>std::vector&lt;cl::Platform&gt; all_platforms;
      cl::Platform::get(&amp;all_platforms);
      if(all_platforms.size()==0){
      std::cout&lt;&lt;" No platforms found. Check OpenCL installation!\n";
      exit(1);
      }
  </code></pre>
  
  <p>This seems so strange given that the C implementation runs without problem.  Any insights would be sincerely appreciated.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The C implementation actually isn't running correctly.  Each addition is printed to equal zero.  Checking the <code>ret_num_platforms</code> also returns 0.  For some reason my setup is failing to find my GPU.  What could I have missed?  My install consists of the nvidia-340 driver and cuda-6.5 installed via <code>apt-get</code> and the <code>.run</code> file respectively.</p>