Search code examples
c++eclipseboosteclipse-cdtpoint-cloud-library

Eclipse CDT automatically pulling in /usr/include/boost when not in include paths


I am trying to build a project with PCL. I am using pcl, vtk-5.8 and eigen3. I am also using boost.

In /usr/include boost 1.46 is there by default and I have built my own version of boost 1.5.1. When adding the path to boost 1.5.1 include dir to the include path (in properties->build->settings) I get errors on launch as my app is being compiled against the files in /usr/include/boost and not the 1.5.1 version. So when I don't include my boost 1.5.1 version everything runs fine.

My question is, how/why is eclipse finding /usr/include as an include path (this has not been explicitly added) and how can I stop it doing this?


Solution

  • Look under Properties->C/C++ General->Paths and Symbols, then the Includes tab. You can set the include directories, and I'm sure you'll find /usr/include there. You might want to leave it in there (it might not even give you the option to remove it) and add your Boost 1.5.1 path above it. Make sure you have C++ selected under "Languages".