OpenCL 1.2 C++ Wrapper – undefined reference to clReleaseDevice-Collection of common programming errors

I am trying to use the OpenCL C++ wrapper API for the following program :

#define __CL_ENABLE_EXCEPTIONS


#include 
#include 
#include 
#include 

 const char helloStr []  = "__kernel void "
                          "hello(void) "
                          "{ "
                          "  "
                          "} ";

 int
 main(void)
 {
    cl_int err = CL_SUCCESS;
    try {

      std::vector platforms;
      cl::Platform::get(&platforms);
      if (platforms.size() == 0) {
          std::cout