Q:

OpenCL not finding platforms?

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 here.  I can compile this program with following gcc call and the program runs without problem.
gcc main.c -o vectorAddition -l OpenCL -I/usr/local/cuda-6.5/include

However, I would very much prefer to use the C++ API as opposed the very verbose host files needed for C.
I downloaded the C++ bindings from Khronos from here and placed the cl.hpp file in the same location as my other cl.h file.  The code uses some C++11 so I can compile the code with:
g++ main.cpp -o vectorAddition_cpp -std=c++11 -l OpenCL -I/usr/local/cuda-6.5/include

but when I try to run the program I get the error:
clGetPlatformIDs(-1001)

I also tried the example provided here as well which gave a more helpful error message.
No platforms found. Check OpenCL installation!

The particular code which provides this error is this:
std::vector<cl::Platform> all_platforms;
    cl::Platform::get(&all_platforms);
    if(all_platforms.size()==0){
    std::cout<<" No platforms found. Check OpenCL installation!\n";
    exit(1);
    }

This seems so strange given that the C implementation runs without problem.  Any insights would be sincerely appreciated.
EDIT
The C implementation actually isn't running correctly.  Each addition is printed to equal zero.  Checking the ret_num_platforms 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 apt-get and the .run file respectively.

A:

My sincerest thanks to @pasternak for helping me troubleshoot this problem.  To solve it however I ended up needing to avoid essentially all ubuntu apt-get calls for install and just use the cuda run file for the full installation.  Here is what fixed the problem.

Purge existing nvidia and cuda implementations (sudo apt-get purge cuda* nvidia-*)
Download cuda-6.5 toolkit from the CUDA toolkit archive
Reboot computer
Switch to ttyl (Ctrl-Alt-F1)
Stop the X server (sudo stop lightdm)
Run the cuda run file (sh cuda_6.5.14_linux_64.run)
Select 'yes' and accept all defaults
Required reboot
Switch to ttyl, stop X server and run the cuda run file again and select 'yes' and default for everything (including the driver again)
Update PATH to include /usr/local/cuda-6.5/bin and LD_LIBRARY_PATH
to include /usr/local/cuda-6.5/lib64
Reboot again
Compile main.c program (gcc main.c -o vectorAddition -l OpenCL -I/usr/local/cuda-6.5/include)
Verify works with ./vectorAddition

C++ API

Download cl.hpp file from Khronos here noting that it is version 1.1
Place cl.hpp file in /usr/local/cuda-6.5/include/CL with other cl headers.
Compile main.cpp (g++ main.cpp -o vectorAddition_cpp -std=c++11 -l OpenCL -I/usr/local/cuda-6.5/include)
Verify it works (./vectorAddition_cpp)

All output from both programs show the correct output for addition between vectors.
I personally find it interesting the Ubuntu's nvidia drivers don't seem to play well with the cuda toolkits.  Possibly just for the older versions but still very unexpected.

