Index: ICLQt/src/GUI.cpp
===================================================================
--- ICLQt/src/GUI.cpp	(revision 3465)
+++ ICLQt/src/GUI.cpp	(working copy)
@@ -124,6 +124,7 @@
 
 #include <map>
 #include <set>
+#include <unistd.h>
 
 using namespace std;
 using namespace icl::utils;
Index: include/ICLCV/FloodFiller.h
===================================================================
--- include/ICLCV/FloodFiller.h	(revision 3465)
+++ include/ICLCV/FloodFiller.h	(working copy)
@@ -215,7 +215,7 @@
           refcol[2] = refb;
         }
         inline bool operator()( const T &r, const T &g, const T &b) const{
-          return sqr(r-refcol[0]) + sqr(g-refcol[1]) + sqr(b-refcol[2])  < maxSquaredEuklDist;
+          return utils::sqr(r-refcol[0]) + utils::sqr(g-refcol[1]) + utils::sqr(b-refcol[2])  < maxSquaredEuklDist;
         }
       };
     };
Index: ICLCV/src/HungarianAlgorithm.cpp
===================================================================
--- ICLCV/src/HungarianAlgorithm.cpp	(revision 3465)
+++ ICLCV/src/HungarianAlgorithm.cpp	(working copy)
@@ -426,6 +426,23 @@
     }
   
     // }}}
+
+    template<class real>
+    real findSmallest(Array2D<real> &cost, vec &rowCover, vec &colCover, real maxCost){
+      // {{{ open
+  
+      real minval = maxCost;	   //There cannot be a larger cost than this.
+      for (int i=0; i<cost.getWidth(); i++){ //Now find the smallest uncovered value.
+        for (int j=0; j<cost.getHeight(); j++){
+          if (rowCover[i]==0 && colCover[j]==0 && (minval > cost(i,j))){
+            minval = cost(i,j);
+          }
+        }
+      }
+      return minval;
+    }
+  
+    // }}}
     
     template<class real>
     int hg_step6(int step, Array2D<real> &cost, vec &rowCover, vec &colCover, real maxCost){
@@ -451,22 +468,6 @@
     }
   
     // }}}
-    template<class real>
-    real findSmallest(Array2D<real> &cost, vec &rowCover, vec &colCover, real maxCost){
-      // {{{ open
-  
-      real minval = maxCost;	   //There cannot be a larger cost than this.
-      for (int i=0; i<cost.getWidth(); i++){ //Now find the smallest uncovered value.
-        for (int j=0; j<cost.getHeight(); j++){
-          if (rowCover[i]==0 && colCover[j]==0 && (minval > cost(i,j))){
-            minval = cost(i,j);
-          }
-        }
-      }
-      return minval;
-    }
-  
-    // }}}
      
     template<class real>
     vec HungarianAlgorithm<real>::apply(const Array2D<real> &m, bool isCostMatrix){
Index: ICLGeom/src/PointCloudCreatorCL.cpp
===================================================================
--- ICLGeom/src/PointCloudCreatorCL.cpp	(revision 3465)
+++ ICLGeom/src/PointCloudCreatorCL.cpp	(working copy)
@@ -219,7 +219,7 @@
                            const Vec O, const unsigned int COLOR_W, const unsigned int COLOR_H, const int DEPTH_DIM, 
                            DataSegment<float,3> xyz, DataSegment<float,4> rgba,
                            const Img8u *rgbIn,const Array2D<Vec3> &dirs, float depthScaling){
-      
+      #ifdef HAVE_OPENCL
       cl_uchar needsMapping;
       if(NEEDS_RAW_TO_MM_MAPPING){
         needsMapping=1;
@@ -227,7 +227,7 @@
         needsMapping=0;
       }
       
-      #ifdef HAVE_OPENCL
+
         try{                             
           depthValuesArray = (float*)depthValues->begin(0);
           depthValuesBuffer = cl::Buffer(//write new image to buffer
@@ -313,6 +313,7 @@
                            const Vec O, const int DEPTH_DIM, 
                            DataSegment<float,3> xyz,const Array2D<Vec3> &dirs, float depthScaling){
       
+    #ifdef HAVE_OPENCL
       cl_uchar needsMapping;
       if(NEEDS_RAW_TO_MM_MAPPING){
         needsMapping=1;
@@ -320,7 +321,6 @@
         needsMapping=0;
       }
       
-      #ifdef HAVE_OPENCL
         try{              
           depthValuesArray = (float*)depthValues->begin(0);
           depthValuesBuffer = cl::Buffer(//write new image to buffer
Index: ICLUtils/src/ProcessMonitor.cpp
===================================================================
--- ICLUtils/src/ProcessMonitor.cpp	(revision 3465)
+++ ICLUtils/src/ProcessMonitor.cpp	(working copy)
@@ -41,7 +41,7 @@
 //#include <sys/time.h>
 //#include <sys/resource.h>
 //#include <sys/types.h>
-//#include <unistd.h>
+#include <unistd.h>
 
 namespace icl{
   namespace utils{
Index: ICLIO/src/DCGrabber.cpp
===================================================================
--- ICLIO/src/DCGrabber.cpp	(revision 3465)
+++ ICLIO/src/DCGrabber.cpp	(working copy)
@@ -36,7 +36,9 @@
 #include <ICLIO/DCGrabberThread.h>
 #include <ICLUtils/SignalHandler.h>
 #include <ICLIO/IOFunctions.h>
+
 #include <dc1394/iso.h>
+#include <unistd.h>
 
 namespace icl{
   namespace io{
Index: ICLIO/src/DCFrameQueue.cpp
===================================================================
--- ICLIO/src/DCFrameQueue.cpp	(revision 3465)
+++ ICLIO/src/DCFrameQueue.cpp	(working copy)
@@ -36,6 +36,8 @@
 #include <ICLIO/DC.h>
 #include <ICLUtils/Macros.h>
 
+#include <unistd.h>
+
 namespace icl{
   namespace io{
     namespace dc{
 
