diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4109f4788df25ac0e3ffab2fdd5067fd4d784117..8ac8388e43b2dc3b85403f587e4f15bc5b8d3242 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,7 +16,7 @@
 # <http://www.gnu.org/licenses/>.
 
 # Requires at least CMake 2.6 to configure the package.
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 
 SET(CXX_DISABLE_WERROR true)
 
diff --git a/include/gepetto/gui/mainwindow.hh b/include/gepetto/gui/mainwindow.hh
index 6103b1314e16049173e3516071896514e20227d5..5b40a5f9243410e8fb2fa9ca759bdb745962a8e9 100644
--- a/include/gepetto/gui/mainwindow.hh
+++ b/include/gepetto/gui/mainwindow.hh
@@ -4,6 +4,8 @@
 #include <QList>
 #include <QStandardItemModel>
 #include <QMainWindow>
+#include <QCheckBox>
+#include <QLabel>
 
 #include <gepetto/viewer/group-node.h>
 
diff --git a/include/gepetto/gui/node-action.hh b/include/gepetto/gui/node-action.hh
index 2f377a3b0388a7ccf5ebb7103dc533e9ea4dc06e..89f5efe1b1e3c75e8cee561e37a58b5cd6dff68e 100644
--- a/include/gepetto/gui/node-action.hh
+++ b/include/gepetto/gui/node-action.hh
@@ -14,6 +14,8 @@ namespace gepetto {
     public:
         NodeActionBase(const QString& text, graphics::NodePtr_t node, QWidget* parent);
 
+        virtual ~NodeActionBase () {}
+
         graphics::NodePtr_t node () const;
 
     protected:
@@ -46,6 +48,8 @@ namespace gepetto {
         /// Attach camera to node
         NodeAction(const QString& text, OSGWidget* window, QWidget* parent);
 
+        virtual ~NodeAction () {}
+
       protected:
         void act(bool checked);
 
diff --git a/include/gepetto/gui/tree-item.hh b/include/gepetto/gui/tree-item.hh
index 865429f546fcd109fb3ed3fbbbf41d9a4f9b5cf1..9ea242728b6fc471ab8c55fdaf8cf0d9fe7242af 100644
--- a/include/gepetto/gui/tree-item.hh
+++ b/include/gepetto/gui/tree-item.hh
@@ -14,8 +14,6 @@
 
 namespace gepetto {
   namespace gui {
-    class BodyTreeItem;
-
     class BodyTreeItem : public QObject, public QStandardItem
     {
       Q_OBJECT
diff --git a/src/gui/bodytreewidget.cc b/src/gui/bodytreewidget.cc
index c5f1e01bfe1a6d833a1921d96748ea3220337281..e0b5ac6083319bd871607d11467a82f98d4d33d1 100644
--- a/src/gui/bodytreewidget.cc
+++ b/src/gui/bodytreewidget.cc
@@ -10,6 +10,8 @@
 
 #include <QSignalMapper>
 #include <QColorDialog>
+#include <QHBoxLayout>
+#include <QApplication>
 
 static void addSelector (QToolBox* tb, QString title, QStringList display, QStringList command,
                          QObject* receiver, const char* slot) {
diff --git a/src/gui/dialog/pluginmanagerdialog.cc b/src/gui/dialog/pluginmanagerdialog.cc
index 3af6cb3b6ff8185fa9e77a75b779fdfba0ea93ef..914f77c2bec1b1dc3fd52184405991ae75207da4 100644
--- a/src/gui/dialog/pluginmanagerdialog.cc
+++ b/src/gui/dialog/pluginmanagerdialog.cc
@@ -2,6 +2,7 @@
 #include "ui_pluginmanagerdialog.h"
 
 #include <QDebug>
+#include <QMenu>
 
 #include "gepetto/gui/plugin-interface.hh"
 
@@ -119,7 +120,7 @@ namespace gepetto {
     }
 
     void PluginManagerDialog::onItemChanged(QTableWidgetItem *current,
-        QTableWidgetItem */*previous*/)
+        QTableWidgetItem* /*previous*/)
     {
       if (!current) return;
       QString key = ui_->pluginList->item(current->row(), FILE)->text();
diff --git a/src/gui/main.cc.in b/src/gui/main.cc.in
index 27297eb90d72d73d0f65064095b411dbd6b122ff..09f1b5edded774c0ea37d0a8f67dfff9aca5376e 100644
--- a/src/gui/main.cc.in
+++ b/src/gui/main.cc.in
@@ -1,6 +1,6 @@
-#include <QtGui/QApplication>
+#include <QApplication>
 #include <QSettings>
-#include <QCleanlooksStyle>
+#include <QCommonStyle>
 #include <QProcessEnvironment>
 #include <QSplashScreen>
 #include <QIcon>
@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
   QApplication::setAttribute(Qt::AA_X11InitThreads);
 
   SafeApplication a(argc, argv);
-  a.setStyle(new QCleanlooksStyle);
+  a.setStyle(new QCommonStyle);
   QPixmap pixmap(":/img/gepetto.png");
   a.setWindowIcon(pixmap);
 
diff --git a/src/gui/mainwindow.cc b/src/gui/mainwindow.cc
index 6f5830cedbd45eb50d44ca7490eb5dab33f2ac89..25ac9f30db20395217da7803de53d47e7f1d938f 100644
--- a/src/gui/mainwindow.cc
+++ b/src/gui/mainwindow.cc
@@ -1,6 +1,9 @@
 #include "gepetto/gui/mainwindow.hh"
 #include "ui_mainwindow.h"
 
+#include <QScrollBar>
+#include <QMessageBox>
+
 #include <gepetto/viewer/corba/server.hh>
 
 #include "gepetto/gui/windows-manager.hh"
diff --git a/src/gui/osgwidget.cc b/src/gui/osgwidget.cc
index a3bfa343781e961edf12a78cc7312e74049ad1f8..e1d554a3f7510228d40876d1725d63e8627494d8 100644
--- a/src/gui/osgwidget.cc
+++ b/src/gui/osgwidget.cc
@@ -31,6 +31,7 @@
 #include <QDebug>
 #include <QKeyEvent>
 #include <QWheelEvent>
+#include <QVBoxLayout>
 
 #include <gepetto/viewer/urdf-parser.h>
 #include <gepetto/viewer/OSGManipulator/keyboard-manipulator.h>
diff --git a/src/gui/pick-handler.cc b/src/gui/pick-handler.cc
index 4259998582857b58527ffcbc039afcd7e082ecd2..50c590ffa2b0cf083a6791df77d76deb3981d10c 100644
--- a/src/gui/pick-handler.cc
+++ b/src/gui/pick-handler.cc
@@ -1,6 +1,7 @@
 #include "gepetto/gui/pick-handler.hh"
 
 #include <QDebug>
+#include <QApplication>
 
 #include <osg/io_utils>
 
diff --git a/src/gui/pythonwidget.cc b/src/gui/pythonwidget.cc
index 24066384632203e0149fe508c1f2ce93cfd56e24..caf1a6ace32f418f64d9c33590f3183314e39e77 100644
--- a/src/gui/pythonwidget.cc
+++ b/src/gui/pythonwidget.cc
@@ -1,5 +1,6 @@
 #include "gepetto/gui/pythonwidget.hh"
 
+#include <QAction>
 #include <QFileDialog>
 #include <PythonQt/PythonQt.h>
 #include <PythonQt/PythonQt_QtAll.h>
diff --git a/src/gui/selection-event.cc b/src/gui/selection-event.cc
index 46ccda58e13fcf12aea9b6e9edb6952abc41af22..23c3ab69a528211549106434a4cf10efaf078b3a 100644
--- a/src/gui/selection-event.cc
+++ b/src/gui/selection-event.cc
@@ -48,7 +48,7 @@ namespace gepetto {
     void SelectionEvent::done()
     {
       c_.fetchAndAddAcquire(-1);
-      if (c_ == 0) {
+      if (c_.testAndSetAcquire(0,0)) {
         deleteLater();
       }
     }