title: NetBeans gives segfault, running the prgram using terminal does not
body: <p>I am confronted to a very weird problem.
  When running my very simple one file program via NetBeans, I have the following error:</p>
  
  <pre><code>RUN FINISHED; Segmentation fault; core dumped; real time: 150ms; user: 0ms; system: 0ms
  </code></pre>
  
  <p>My run command is simple ./Name-Of-The-File.</p>
  
  <p>When I use a terminal and cd to the folder containing the program and run the same command, I get the following output:</p>
  
  <pre><code>Hullo
  PLatform Number is : 1
  Hullo
  </code></pre>
  
  <p>(Note that the Hullos were added to pinpoint where the segfault happened, as my very first line in main() prints Hullo.)</p>
  
  <p>Here is the code of the program:</p>
  
  <pre><code>/* 
   * File:   main.cpp
   * Author: sysgen
   *
   * Created on June 4, 2015, 7:08 PM
   */
  
  #include &lt;cstdio&gt;
  #include &lt;cstdlib&gt;
  #include &lt;iostream&gt;
  #include &lt;utility&gt;
  #include &lt;CL/cl.hpp&gt;
  
  const std::string hw("Hello World \n");
  
  /*
   * 
   */
  
  //OpenCL Error checking function
  
  inline void checkErr(cl_int err, const char *name){
      if (err != CL_SUCCESS){
          std::cerr &lt;&lt; "FATAL OPENCL ERROR: " &lt;&lt; name &lt;&lt; "( " &lt;&lt; err &lt;&lt; ") " &lt;&lt; std::endl;
          exit(EXIT_FAILURE);
      }
  }
  
  int main(void) {
      //Creating an OpenCL context
  
      std::cout &lt;&lt; "Hullo" &lt;&lt; std::endl;
  
      cl_int err;
      std::vector&lt; cl::Platform &gt; platformList; //We make a vector which will contain the platforms
      cl::Platform::get(&amp;platformList);
      checkErr(platformList.size() !=0 ? CL_SUCCESS : -1, "cl::Platform::get");
      std::cerr &lt;&lt; "PLatform Number is : " &lt;&lt; platformList.size() &lt;&lt; std::endl;
      std::string platformVendor;
      platformList[0].getInfo((cl_platform_info)CL_PLATFORM_VENDOR, &amp;platformVendor);
  
      std::cout &lt;&lt; "Hullo" &lt;&lt; std::endl;
  
      return 0;
  }
  </code></pre>
  
  <p><strong>This error also manifests in codeblocks. There is more details produced by gdb:</strong></p>
  
  <pre><code>Building to ensure sources are up-to-date
  Selecting target: 
  Debug
  Adding source dir: /home/sysgen/NetBeansProjects/OpenCL SVOGL/
  Adding source dir: /home/sysgen/NetBeansProjects/OpenCL SVOGL/
  Adding file: /home/sysgen/NetBeansProjects/OpenCL SVOGL/bin/Debug/OpenCL SVOGL
  Changing directory to: "/home/sysgen/NetBeansProjects/OpenCL SVOGL/."
  Set variable: LD_LIBRARY_PATH=.:/opt/AMDAPPSDK-3.0-0-Beta/lib/x86_64/:/usr/lib32
  Starting debugger: /usr/bin/gdb -nx -fullname  -quiet  -args "/home/sysgen/NetBeansProjects/OpenCL SVOGL/bin/Debug/OpenCL SVOGL"
  done
  Registered new type: wxString
  Registered new type: STL String
  Registered new type: STL Vector
  Setting breakpoints
  Reading symbols from /home/sysgen/NetBeansProjects/OpenCL SVOGL/bin/Debug/OpenCL SVOGL...(no debugging symbols found)...done.
  Debugger name and version: GNU gdb (Ubuntu 7.9-1ubuntu1) 7.9
  Program received signal SIGSEGV, Segmentation fault.
  In ?? () ()
  177 dlerror.c: No such file or directory.
  #1  0x00007ffff70dd6fd in init () at dlerror.c:177
  </code></pre>