diff --git a/Common/Gmsh.cpp b/Common/Gmsh.cpp
index f6ca2db0230d43a2091272853ae1c5d3209e7225..23a3ef30054cf6d98cbf6e835b8cea77a776ff66 100644
--- a/Common/Gmsh.cpp
+++ b/Common/Gmsh.cpp
@@ -190,7 +190,7 @@ double GmshGetNumberOption(const std::string &category, const std::string &name,
   return value;
 }
 
-int GmshGetColorOption(const std::string &category, const std::string &name,
+unsigned int GmshGetColorOption(const std::string &category, const std::string &name,
                        int index)
 {
   unsigned int value;
diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp
index 7855de77cd3b13226430ff218df399c8a2a32436..4a8847a4e4a6ac1c17b56552b5093651b3fcff3a 100644
--- a/Common/GmshMessage.cpp
+++ b/Common/GmshMessage.cpp
@@ -70,20 +70,22 @@ onelab::client *Msg::_onelabClient = 0;
 onelab::server *onelab::server::_server = 0;
 #endif
 
+
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1310) //NET 2003
+#define vsnprintf _vsnprintf
+#else
 #if defined(HAVE_NO_VSNPRINTF)
 static int vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
 {
-  if(strlen(fmt) > size - 1){ // just copy the format
-    strncpy(str, fmt, size - 1);
-    str[size - 1] = '\0';
-    return size;
-  }
-  return vsprintf(str, fmt, ap);
-}
+	if (strlen(fmt) > size - 1) { // just copy the format
+		strncpy(str, fmt, size - 1);
+		str[size - 1] = '\0';
+		return size;
+	}
+	return vsprintf(str, fmt, ap);
+	}
 #endif
-
-#if defined(_MSC_VER) && (_MSC_VER == 1310) //NET 2003
-#define vsnprintf _vsnprintf
 #endif
 
 static void addGmshPathToEnvironmentVar(const std::string &name)
@@ -156,6 +158,128 @@ void Msg::Init(int argc, char **argv)
   InitializeOnelab("Gmsh");
 }
 
+int Msg::GetCommRank()
+{
+  return _commRank;
+}
+
+int Msg::GetCommSize()
+{
+  return _commSize;
+}
+
+void Msg::SetCommRank(int val)
+{
+  _commRank = val;
+}
+
+void Msg::SetCommSize(int val)
+{
+  _commSize = val;
+}
+
+void Msg::SetCallback(GmshMessage *callback)
+{
+  _callback = callback;
+}
+
+GmshMessage *Msg::GetCallback()
+{
+  return _callback;
+}
+
+void Msg::SetVerbosity(int val)
+{
+  _verbosity = val;
+}
+
+int Msg::GetVerbosity()
+{
+  return _verbosity;
+}
+
+std::string Msg::GetLaunchDate()
+{
+  return _launchDate;
+}
+
+std::string Msg::GetCommandLineArgs()
+{
+  return _commandLine;
+}
+
+std::map<std::string, std::vector<double> > &Msg::GetCommandLineNumbers()
+{
+  return _commandLineNumbers;
+}
+
+std::map<std::string, std::string> &Msg::GetCommandLineStrings()
+{
+  return _commandLineStrings;
+}
+
+void Msg::SetProgressMeterStep(int step)
+{
+  _progressMeterStep = step;
+}
+
+int Msg::GetProgressMeterStep()
+{
+  return _progressMeterStep;
+}
+
+void Msg::ResetProgressMeter()
+{
+  if (!_commRank) _progressMeterCurrent = 0;
+}
+
+void Msg::SetInfoCpu(bool val)
+{
+  _infoCpu = val;
+}
+
+double &Msg::Timer(std::string str)
+{
+  return _timers[str];
+}
+
+int Msg::GetWarningCount()
+{
+  return _warningCount;
+}
+
+int Msg::GetErrorCount()
+{
+  return _errorCount;
+}
+
+std::string Msg::GetFirstWarning()
+{
+  return _firstWarning;
+}
+
+std::string Msg::GetFirstError()
+{
+  return _firstError;
+}
+
+void Msg::SetExecutableName(const std::string &name)
+{
+  _execName.assign(name);
+}
+
+std::string Msg::GetExecutableName()
+{
+  return _execName;
+}
+
+#if defined(HAVE_ONELAB)
+onelab::client *Msg::GetOnelabClient()
+{
+  return _onelabClient;
+}
+#endif
+
 void Msg::Exit(int level)
 {
   if (GModel::current())
@@ -1050,6 +1174,12 @@ void Msg::LoadOnelabClient(const std::string &clientName, const std::string &soc
 #endif
 }
 
+GmshClient *Msg::GetGmshClient()
+{ 
+	return _client;
+}
+
+
 int Msg::GetNumOnelabClients()
 {
 #if defined(HAVE_ONELAB)
diff --git a/Common/GmshMessage.h b/Common/GmshMessage.h
index 0e3c68504adefb33669b7387b91a0396e398d00c..ed2236138c31efa37599ef5cd0e3264584ae943b 100644
--- a/Common/GmshMessage.h
+++ b/Common/GmshMessage.h
@@ -62,28 +62,22 @@ class Msg {
   Msg() {}
   static void Init(int argc, char **argv);
   static void Exit(int level);
-  static int GetCommRank(){ return _commRank; }
-  static int GetCommSize(){ return _commSize; }
-  static void SetCommRank(int val){ _commRank = val; }
-  static void SetCommSize(int val){ _commSize = val; }
-  static void SetCallback(GmshMessage *callback){ _callback = callback; }
-  static GmshMessage *GetCallback(){ return _callback; }
+  static int GetCommRank();
+  static int GetCommSize();
+  static void SetCommRank(int val);
+  static void SetCommSize(int val);
+  static void SetCallback(GmshMessage *callback);
+  static GmshMessage *GetCallback();
   static void Barrier();
   static int GetNumThreads();
   static int GetMaxThreads();
   static int GetThreadNum();
-  static void SetVerbosity(int val){ _verbosity = val; }
-  static int GetVerbosity(){ return _verbosity; }
-  static std::string GetLaunchDate(){ return _launchDate; }
-  static std::string GetCommandLineArgs(){ return _commandLine; }
-  static std::map<std::string, std::vector<double> > &GetCommandLineNumbers()
-  {
-    return _commandLineNumbers;
-  }
-  static std::map<std::string, std::string> &GetCommandLineStrings()
-  {
-    return _commandLineStrings;
-  }
+  static void SetVerbosity(int val);
+  static int GetVerbosity();
+  static std::string GetLaunchDate();
+  static std::string GetCommandLineArgs();
+  static std::map<std::string, std::vector<double> > &GetCommandLineNumbers();
+  static std::map<std::string, std::string> &GetCommandLineStrings();
   static std::string PrintResources(bool printDate, bool printWallTime,
                                     bool printCpu, bool printMem);
   static void Fatal(const char *fmt, ...);
@@ -97,30 +91,30 @@ class Msg {
   static void SetWindowTitle(const std::string &title);
   static void Debug(const char *fmt, ...);
   static void ProgressMeter(int n, int N, bool log, const char *fmt, ...);
-  static void SetProgressMeterStep(int step){ _progressMeterStep = step; }
-  static int GetProgressMeterStep(){ return _progressMeterStep; }
-  static void ResetProgressMeter(){ if(!_commRank) _progressMeterCurrent = 0; }
-  static void SetInfoCpu(bool val){ _infoCpu = val; }
-  static double &Timer(std::string str){ return _timers[str]; }
+  static void SetProgressMeterStep(int step);
+  static int GetProgressMeterStep();
+  static void ResetProgressMeter();
+  static void SetInfoCpu(bool val);
+  static double &Timer(std::string str);
   static void PrintTimers();
   static void ResetErrorCounter();
   static void PrintErrorCounter(const char *title);
-  static int GetWarningCount(){ return _warningCount; }
-  static int GetErrorCount(){ return _errorCount; }
-  static std::string GetFirstWarning(){ return _firstWarning; }
-  static std::string GetFirstError(){ return _firstError; }
+  static int GetWarningCount();
+  static int GetErrorCount();
+  static std::string GetFirstWarning();
+  static std::string GetFirstError();
   static double GetValue(const char *text, double defaultval);
   static std::string GetString(const char *text, std::string defaultval);
   static int GetAnswer(const char *question, int defaultval, const char *zero,
                        const char *one, const char *two=0);
   static void InitializeOnelab(const std::string &name, const std::string &sockname="");
-  static void SetExecutableName(const std::string &name) { _execName.assign(name); }
-  static std::string GetExecutableName() { return _execName; }
+  static void SetExecutableName(const std::string &name);
+  static std::string GetExecutableName();
   static void LoadOnelabClient(const std::string &name, const std::string &sockName);
   static int GetNumOnelabClients();
-  static GmshClient *GetGmshClient(){ return _client; }
+  static GmshClient *GetGmshClient();
 #if defined(HAVE_ONELAB)
-  static onelab::client *GetOnelabClient(){ return _onelabClient; }
+  static onelab::client *GetOnelabClient();
 #endif
   static void FinalizeOnelab();
   static bool UseOnelab();
diff --git a/Fltk/FlGui.cpp b/Fltk/FlGui.cpp
index f1aa75b2eda8fb389e85a3cb3e4db957b0ec58b0..cae10bd5fe5f0bf3c8a489efc569a16a7d30aff0 100644
--- a/Fltk/FlGui.cpp
+++ b/Fltk/FlGui.cpp
@@ -60,6 +60,16 @@ void FlGui::wait(){ Fl::wait(); }
 // wait (at most time seconds) for any events, then process them
 void FlGui::wait(double time){ Fl::wait(time); }
 
+void FlGui::setOpenedThroughMacFinder(const std::string &name)
+{
+  _openedThroughMacFinder = name;
+}
+
+std::string FlGui::getOpenedThroughMacFinder()
+{
+  return _openedThroughMacFinder;
+}
+
 static int globalShortcut(int event)
 {
   if(!FlGui::available()) return 0;
@@ -449,6 +459,12 @@ FlGui::FlGui(int argc, char **argv)
 FlGui *FlGui::_instance = 0;
 std::string FlGui::_openedThroughMacFinder = "";
 
+bool FlGui::available()
+{
+  return (_instance != 0);
+}
+
+
 FlGui *FlGui::instance(int argc, char **argv)
 {
   if(!_instance){
diff --git a/Fltk/FlGui.h b/Fltk/FlGui.h
index a7c015e2e3b58a7083326d43db89e55fc3b3d45d..0f28eecc6400c66182e576afaa75d5133a63d9af 100644
--- a/Fltk/FlGui.h
+++ b/Fltk/FlGui.h
@@ -80,7 +80,7 @@ class FlGui{
   // return the single static instance of the GUI
   static FlGui *instance(int argc=0, char **argv=0);
   // check if the GUI is available
-  static bool available(){ return (_instance != 0); }
+  static bool available();
   // run the GUI until there's no window left
   static int run();
   // check (now!) if there are any pending events, and process them
@@ -90,11 +90,8 @@ class FlGui{
   // wait (at most time seconds) for any events, then process them
   static void wait(double time);
   // is a file opened through the Mac Finder?
-  static void setOpenedThroughMacFinder(const std::string &name)
-  {
-    _openedThroughMacFinder = name;
-  }
-  static std::string getOpenedThroughMacFinder(){ return _openedThroughMacFinder; }
+ static void setOpenedThroughMacFinder(const std::string &name);
+  static std::string getOpenedThroughMacFinder();
   // test application-level keyboard shortcuts
   int testGlobalShortcuts(int event);
   // test the arrow shortcuts (not in the application-level shortcuts)
diff --git a/Geo/GModel.h b/Geo/GModel.h
index 78de5e1bbcbc1f074d74b48e504fb408e9459569..60a5a21b511161956490a24ec6e86aa81f0830ff 100644
--- a/Geo/GModel.h
+++ b/Geo/GModel.h
@@ -165,9 +165,10 @@ class GModel
   GModel(std::string name="");
   virtual ~GModel();
 
-
+#ifndef SWIG
   // the static list of all loaded models
   static std::vector<GModel*> list;
+#endif
 
   // return the current model, and sets the current model index if
   // index >= 0
diff --git a/Geo/MEdge.cpp b/Geo/MEdge.cpp
index 3d57fdfa5f059001d212b304fc740bb05c9b579a..5e557ffda0b4ca0d1830737a43ef8637609c6898 100644
--- a/Geo/MEdge.cpp
+++ b/Geo/MEdge.cpp
@@ -9,7 +9,7 @@
 
 bool MEdge::isInside(MVertex *v) const
 {
-  double tol = MVertexLessThanLexicographic::tolerance;
+  double tol = MVertexLessThanLexicographic::getTolerance();
   MVertex *v0 = _v[0];
   MVertex *v1 = _v[1];
   MVertexLessThanLexicographic lt;
diff --git a/Geo/MElement.cpp b/Geo/MElement.cpp
index 71af67d7f994f2119052e10f95e90fbf7308c294..662a48a816e6606650630f8a0c42732545ffa389 100644
--- a/Geo/MElement.cpp
+++ b/Geo/MElement.cpp
@@ -138,6 +138,16 @@ MElement* MElement::createElement(int tag, const std::vector<MVertex*> &vertices
   return NULL;
 }
 
+void MElement::setTolerance(const double tol)
+{
+  _isInsideTolerance = tol;
+}
+
+double MElement::getTolerance()
+{
+  return _isInsideTolerance;
+}
+
 void MElement::_getEdgeRep(MVertex *v0, MVertex *v1,
                            double *x, double *y, double *z, SVector3 *n,
                            int faceIndex)
diff --git a/Geo/MElement.h b/Geo/MElement.h
index abf4c161a3a0f456bb51dc354b8e175a1ecc02fe..acf8ed582e2f2fe9667b096908a80941307aa7d3 100644
--- a/Geo/MElement.h
+++ b/Geo/MElement.h
@@ -53,8 +53,8 @@ class MElement
                                  int num=0, int part=0);
 
   // set/get the tolerance for isInside() test
-  static void setTolerance(const double tol){ _isInsideTolerance = tol; }
-  static double getTolerance() { return _isInsideTolerance; }
+  static void setTolerance(const double tol);
+  static double getTolerance();
 
   // return the tag of the element
   virtual int getNum() const { return _num; }
diff --git a/Geo/MHexahedron.h b/Geo/MHexahedron.h
index 7caea468130c7628c330b0abd326368bb9778e8f..30a25d63c633e61763f632786d09915bd6c618e8 100644
--- a/Geo/MHexahedron.h
+++ b/Geo/MHexahedron.h
@@ -147,7 +147,7 @@ class MHexahedron : public MElement {
   }
   virtual bool isInside(double u, double v, double w) const
   {
-    double tol = _isInsideTolerance;
+    double tol = getTolerance();
     if(u < -(1. + tol) || v < -(1. + tol) || w < -(1. + tol) ||
        u > (1. + tol) || v > (1. + tol) || w > (1. + tol))
       return false;
diff --git a/Geo/MLine.h b/Geo/MLine.h
index ad7a9a572207e6e257813e7706e0c464124b4501..e952851565020d62cb6d3d51b1891b1b69db9c86 100644
--- a/Geo/MLine.h
+++ b/Geo/MLine.h
@@ -77,7 +77,7 @@ class MLine : public MElement {
   }
   virtual bool isInside(double u, double v, double w) const
   {
-    double tol = _isInsideTolerance;
+    double tol = getTolerance();
     if(u < -(1. + tol) || u > (1. + tol) || fabs(v) > tol || fabs(w) > tol)
       return false;
     return true;
diff --git a/Geo/MPoint.h b/Geo/MPoint.h
index 4e95a2d9aff4eb38ffb70c440bf6f68295e81a9e..1891f214027c76af03ec132842f6170f5fad0d55 100644
--- a/Geo/MPoint.h
+++ b/Geo/MPoint.h
@@ -67,7 +67,7 @@ class MPoint : public MElement {
   }
   virtual bool isInside(double u, double v, double w) const
   {
-    double tol = _isInsideTolerance;
+    double tol = getTolerance();
     if(fabs(u) > tol || fabs(v) > tol || fabs(w) > tol)
       return false;
     return true;
diff --git a/Geo/MPrism.h b/Geo/MPrism.h
index 1d4bbf29f1fe6cecd2d4b974619ce325b4ad059a..a9925a73af43c4a1f8bde4d429c2c96a2c0fe35c 100644
--- a/Geo/MPrism.h
+++ b/Geo/MPrism.h
@@ -148,7 +148,7 @@ class MPrism : public MElement {
   }
   virtual bool isInside(double u, double v, double w) const
   {
-    double tol = _isInsideTolerance;
+    double tol = getTolerance();
     if(w > (1. + tol) || w < -(1. + tol) || u < (-tol)
        || v < (-tol) || u > ((1. + tol) - v))
       return false;
diff --git a/Geo/MPyramid.h b/Geo/MPyramid.h
index 57508dbf8dfcf16b1c0e0d794b2ac9b59686e2f4..a805be9faa7265b431e80840607eebaca101eead 100644
--- a/Geo/MPyramid.h
+++ b/Geo/MPyramid.h
@@ -143,7 +143,7 @@ class MPyramid : public MElement {
   }
   virtual bool isInside(double u, double v, double w) const
   {
-    double tol = _isInsideTolerance;
+    double tol = getTolerance();
     if(u < (w - (1. + tol)) || u > ((1. + tol) - w) || v < (w - (1. + tol)) ||
        v > ((1. + tol) - w) || w < (-tol) || w > (1. + tol))
       return false;
diff --git a/Geo/MQuadrangle.h b/Geo/MQuadrangle.h
index 4a522f28cdcd6a7545fde877cc762246fb8c8bfd..0ceffbcf55cf156ee2b5b5bb1912aa8022f58a3e 100644
--- a/Geo/MQuadrangle.h
+++ b/Geo/MQuadrangle.h
@@ -145,7 +145,7 @@ class MQuadrangle : public MElement {
 
   virtual bool isInside(double u, double v, double w) const
   {
-    double tol = _isInsideTolerance;
+    double tol = getTolerance();
     if(u < -(1. + tol) || v < -(1. + tol) || u > (1. + tol) || v > (1. + tol) ||
        fabs(w) > tol)
       return false;
diff --git a/Geo/MTetrahedron.h b/Geo/MTetrahedron.h
index 66b56bd0e6964e9bdc1afdb7762d536eb3c34030..1b25040f3f0f7a5024f87542194a9b6cad05c6e2 100644
--- a/Geo/MTetrahedron.h
+++ b/Geo/MTetrahedron.h
@@ -146,7 +146,7 @@ class MTetrahedron : public MElement {
   }
   virtual bool isInside(double u, double v, double w) const
   {
-    double tol = _isInsideTolerance;
+    double tol = getTolerance();
     if(u < (-tol) || v < (-tol) || w < (-tol) || u > ((1. + tol) - v - w))
       return false;
     return true;
diff --git a/Geo/MTriangle.h b/Geo/MTriangle.h
index f053a68d2228eb7bd8e0357c5cedb4c51ea78da0..31b856fb566b5d7eaa32aeda6171a646eabc15e5 100644
--- a/Geo/MTriangle.h
+++ b/Geo/MTriangle.h
@@ -147,7 +147,7 @@ class MTriangle : public MElement {
   }
   virtual bool isInside(double u, double v, double w) const
   {
-    double tol = _isInsideTolerance;
+    double tol = getTolerance();
     if(u < (-tol) || v < (-tol) || u > ((1. + tol) - v) || fabs(w) > tol)
       return false;
     return true;
diff --git a/Geo/MTrihedron.h b/Geo/MTrihedron.h
index 94a3f9c6d985e60dceedcfb38347dc433c86e32f..55b0d53e9c7c8ca7b9e83701bf8f5e965c02a6a6 100644
--- a/Geo/MTrihedron.h
+++ b/Geo/MTrihedron.h
@@ -131,7 +131,7 @@ class MTrihedron : public MElement {
   }
   virtual bool isInside(double u, double v, double w) const
   {
-    double tol = _isInsideTolerance;
+    double tol = getTolerance();
     if(u < -(1. + tol) || v < -(1. + tol) || u > (1. + tol) || v > (1. + tol) ||
        fabs(w) > tol)
       return false;
diff --git a/Geo/MVertex.cpp b/Geo/MVertex.cpp
index dc71217037ac4af04b9185a8776cec197742624e..771eb191c96520b5994dfdcdf23db1905635a73f 100644
--- a/Geo/MVertex.cpp
+++ b/Geo/MVertex.cpp
@@ -358,6 +358,11 @@ bool MVertexLessThanNum::operator()(const MVertex *v1, const MVertex *v2) const
 
 double MVertexLessThanLexicographic::tolerance = 1.e-6;
 
+double MVertexLessThanLexicographic::getTolerance()
+{
+  return tolerance;
+}
+
 bool MVertexLessThanLexicographic::operator()(const MVertex *v1, const MVertex *v2) const
 {
   // you should not use this unless you know what you are doing; to create
diff --git a/Geo/MVertex.h b/Geo/MVertex.h
index 2a2a0c631606c8a8966d0ae8d7b934b9328cdbf0..87c5374170c116bcc0c33d563ff54f67242cee70 100644
--- a/Geo/MVertex.h
+++ b/Geo/MVertex.h
@@ -146,8 +146,9 @@ class MFaceVertex : public MVertex{
 };
 
 class MVertexLessThanLexicographic{
- public:
   static double tolerance;
+public:
+  static double getTolerance();
   bool operator()(const MVertex *v1, const MVertex *v2) const;
 };
 
diff --git a/Mesh/directions3D.h b/Mesh/directions3D.h
index e8d4e5696901c181f42765c11bc1a58e3e6b06e4..3f980540ea8c67c589333d61bcc62cdd9acb801b 100644
--- a/Mesh/directions3D.h
+++ b/Mesh/directions3D.h
@@ -36,6 +36,8 @@ class Frame_field{
   static ANNkd_tree* annTree;
 #endif
   Frame_field();
+  static std::map<MVertex*, std::set<MVertex*> > vertex_to_vertices;
+  static std::map<MVertex*, std::set<MElement*> > vertex_to_elements;
  public:
   static void init_region(GRegion*);
   static void init_face(GFace*);
@@ -44,8 +46,6 @@ class Frame_field{
   static void print_field1();
   static void print_field2(GRegion*);
   static void print_segment(SPoint3,SPoint3,double,double,std::ofstream&);
-  static std::map<MVertex*,std::set<MVertex*> > vertex_to_vertices;
-  static std::map<MVertex*,std::set<MElement*> > vertex_to_elements;
   static int build_vertex_to_vertices(GEntity* gr, int onWhat, bool initialize=true);
   static int build_vertex_to_elements(GEntity* gr, bool initialize=true);
   static void build_listVertices(GEntity* gr, int dim, bool initialize=true);
diff --git a/Plugin/Plugin.h b/Plugin/Plugin.h
index 75236534df819bdef1b3793657b30c6d619f5005..00ca4a8ccc8caf01f73b886abc86703797c6b9a2 100644
--- a/Plugin/Plugin.h
+++ b/Plugin/Plugin.h
@@ -71,7 +71,9 @@ class GMSH_Plugin
 
   // dynamic pointer to a drawing function
   static void setDrawFunction(void (*fct)(void *));
+#ifndef SWIG
   static void (*draw)(void*);
+#endif
 };
 
 // The base class for post-processing plugins. The user can either
diff --git a/Post/PView.cpp b/Post/PView.cpp
index 8636b6f31b99b6aba1f627ed077a4eec2c4d9fb1..e599d4fafafd42a1e958af6d4fa106435b800426 100644
--- a/Post/PView.cpp
+++ b/Post/PView.cpp
@@ -174,6 +174,16 @@ PView::~PView()
   delete _data;
 }
 
+int PView::getGlobalTag()
+{
+  return _globalTag;
+}
+
+void PView::setGlobalTag(int tag)
+{
+  _globalTag = tag;
+}
+
 void PView::deleteVertexArrays()
 {
   if(va_points) delete va_points; va_points = 0;
diff --git a/Post/PView.h b/Post/PView.h
index 78922d7ef6c2a8993369e826f3d5691840c08665..3c8f56d44e8bdf48b1c3f3d1128d773870ecf132 100644
--- a/Post/PView.h
+++ b/Post/PView.h
@@ -62,8 +62,8 @@ class PView{
   ~PView();
 
   // set/get global tag
-  static int getGlobalTag(){ return _globalTag; }
-  static void setGlobalTag(int tag){ _globalTag = tag; }
+  static int getGlobalTag();
+  static void setGlobalTag(int tag);
 
   // delete the vertex arrays, used to draw the view efficiently
   void deleteVertexArrays();
@@ -98,8 +98,10 @@ class PView{
   // get (approx.) memory used by the view, in Mb
   double getMemoryInMb();
 
+#ifndef SWIG
   // the static list of all loaded views
   static std::vector<PView*> list;
+#endif
 
   // combine view
   static void combine(bool time, int how, bool remove);
diff --git a/Post/PViewData.cpp b/Post/PViewData.cpp
index f08cdf003254862c176fb0b61bfc2508401ca1de..1d8ee66b208ee36aa3a0c7adaba02310137f1256 100644
--- a/Post/PViewData.cpp
+++ b/Post/PViewData.cpp
@@ -213,6 +213,12 @@ void PViewData::addMatrixToInterpolationScheme(const std::string &name, int type
   _interpolationSchemes[name][type].push_back(new fullMatrix<double>(mat));
 }
 
+int PViewData::getSizeInterpolationScheme()
+{
+  return _interpolationSchemes.size();
+}
+
+
 void PViewData::smooth()
 {
   Msg::Error("Smoothing is not implemented for this type of data");
diff --git a/Post/PViewData.h b/Post/PViewData.h
index 1723b0e2fdb6c5d20257ca1ba6cf9c459405425a..7feec8a8a16fd34314ef5d1fe6117d2061d5fcfe 100644
--- a/Post/PViewData.h
+++ b/Post/PViewData.h
@@ -231,7 +231,7 @@ class PViewData {
   static void removeAllInterpolationSchemes();
   static void addMatrixToInterpolationScheme(const std::string &name, int type,
                                              fullMatrix<double> &mat);
-  static int getSizeInterpolationScheme() { return _interpolationSchemes.size(); }
+  static int getSizeInterpolationScheme();
   std::string getInterpolationSchemeName() { return _interpolationSchemeName; }
   void setInterpolationSchemeName(std::string name) { _interpolationSchemeName = name; }
 
diff --git a/contrib/MeshOptimizer/MeshOpt.cpp b/contrib/MeshOptimizer/MeshOpt.cpp
index 4112cb91adc3013c3f00c0a14f50d43845fcd2c6..ab59d42cf5957e20a2cbba28aba7b4a793338b42 100644
--- a/contrib/MeshOptimizer/MeshOpt.cpp
+++ b/contrib/MeshOptimizer/MeshOpt.cpp
@@ -64,7 +64,6 @@ void printProgressFunc(const alglib::real_1d_array &x, double Obj, void *MOInst)
 
 }
 
-
 MeshOpt::MeshOpt(const std::map<MElement*,GEntity*> &element2entity,
                  const std::map<MElement*, GEntity*> &bndEl2Ent,
                  const std::set<MElement*> &els, std::set<MVertex*> &toFix,
diff --git a/contrib/MeshOptimizer/MeshOpt.h b/contrib/MeshOptimizer/MeshOpt.h
index 737b8549886aee2b1f94bf0a11852d33f2449900..bcffbdb46d602ed8ecba43a680b3ad53e4744d95 100644
--- a/contrib/MeshOptimizer/MeshOpt.h
+++ b/contrib/MeshOptimizer/MeshOpt.h
@@ -34,8 +34,11 @@
 #include <fstream>
 #include <string>
 #include <math.h>
+#include <map>
+#include <set>
 #include "MeshOptObjectiveFunction.h"
 #include "MeshOptPatch.h"
+#include "GmshConfig.h"
 
 #if defined(HAVE_BFGS)
 
diff --git a/contrib/MeshOptimizer/MeshOptCommon.h b/contrib/MeshOptimizer/MeshOptCommon.h
index 900d35127b196dc19ea6d2b0baac6e5f7c77c1ae..7dd25dc4b1c02a27d64eb4df9e0b2273b548b6e1 100644
--- a/contrib/MeshOptimizer/MeshOptCommon.h
+++ b/contrib/MeshOptimizer/MeshOptCommon.h
@@ -103,7 +103,8 @@ struct MeshOptPass {                                    // Parameters controllin
 };
 
 
-struct MeshOptParameters {                              // Parameters controlling the strategy
+class MeshOptParameters {                              // Parameters controlling the strategy
+ public:
   int dim ;                                             // Which dimension to optimize
   bool onlyVisible ;                                    // Apply optimization to visible entities ONLY
   bool fixBndNodes;                                     // If points can move on boundaries
diff --git a/contrib/onelab/OnelabMessage.cpp b/contrib/onelab/OnelabMessage.cpp
index e73e005ff4653427416a9dee35e3196fbb524e93..131108f6dc309712e7527fc5784dd913dd4255b8 100644
--- a/contrib/onelab/OnelabMessage.cpp
+++ b/contrib/onelab/OnelabMessage.cpp
@@ -33,7 +33,9 @@ bool OLMsg::hasGmsh=false;
 std::set<std::string, fullNameLessThan> OLMsg::_fullNameDict;
 void (*OLMsg::gui_wait_fct)(double time) = 0;
 
-
+#if defined(_MSC_VER) && (_MSC_VER >= 1310) //NET 2003
+#define vsnprintf _vsnprintf
+#else
 #if defined(HAVE_NO_VSNPRINTF)
 static int vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
 {
@@ -45,11 +47,10 @@ static int vsnprintf(char *str, size_t size, const char *fmt, va_list ap)
   return vsprintf(str, fmt, ap);
 }
 #endif
-
-#if defined(_MSC_VER) && (_MSC_VER == 1310) //NET 2003
-#define vsnprintf _vsnprintf
 #endif
 
+
+
 void OLMsg::Init(int argc, char **argv)
 {
   time_t now;