diff --git a/Adapt/Adapt.cpp b/Adapt/Adapt.cpp
index 289f368fb6a9eff3be88b4b23cb49731455d4401..4dd75a2a8c992fc52bbb6cc4d457a7328181bd7d 100644
--- a/Adapt/Adapt.cpp
+++ b/Adapt/Adapt.cpp
@@ -1,4 +1,4 @@
-// $Id: Adapt.cpp,v 1.3 2001-01-08 08:05:39 geuzaine Exp $
+// $Id: Adapt.cpp,v 1.4 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Adapt.h"
@@ -184,7 +184,7 @@ double AdaptMesh (int N,        /* Number of elements */
     break;
 
   default :
-    Msg(ERROR, "Unknown Adaption Method");
+    Msg(GERROR, "Unknown Adaption Method");
   }
 
   return(contr) ;
diff --git a/Common/Context.cpp b/Common/Context.cpp
index e2497cf6e9af4a95b9742c187acb4e7e6dcd9358..e653fa3a4df6f554c715affafdae5c559e8fa946 100644
--- a/Common/Context.cpp
+++ b/Common/Context.cpp
@@ -1,4 +1,4 @@
-// $Id: Context.cpp,v 1.26 2001-01-09 14:24:05 geuzaine Exp $
+// $Id: Context.cpp,v 1.27 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Const.h"
@@ -177,7 +177,7 @@ int Get_ColorForString(StringX4Int SX4I[], int alpha,
 
 void Init_Colors(int num){
   if(num < 0 || num > 2){
-    Msg(ERROR, "Unknown Default Color Scheme");
+    Msg(GERROR, "Unknown Default Color Scheme");
     return;
   }
   CTX.color.id = num ;
diff --git a/Common/GetOptions.cpp b/Common/GetOptions.cpp
index 03849ed8d64a4e66a0cd364ca2ca5485fd91a428..86bc35d1d6993ae7f7e1491f18a1cd140d0d3896 100644
--- a/Common/GetOptions.cpp
+++ b/Common/GetOptions.cpp
@@ -1,11 +1,11 @@
-// $Id: GetOptions.cpp,v 1.1 2001-01-08 08:08:47 geuzaine Exp $
+// $Id: GetOptions.cpp,v 1.2 2001-01-09 19:40:56 remacle Exp $
 #include "Gmsh.h"
 #include "Const.h"
 #include "Context.h"
 #include "Geo.h"
 #include "Mesh.h"
 #include "Views.h"
-#include "Version.h"
+#include "./Version.h"
 
 extern Context_T  CTX;
 
diff --git a/Common/GmshUI.h b/Common/GmshUI.h
index 6bc92ed977b2c6fa8893858542c15908f68f41d7..3b51c73c2ed019379c4956217c0673c37755544a 100644
--- a/Common/GmshUI.h
+++ b/Common/GmshUI.h
@@ -1,6 +1,12 @@
 #ifndef _GMSH_UI_H_
 #define _GMSH_UI_H_
 
+#ifdef WIN32
+#include <windows.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+#endif
+
 #if _XMOTIF // X11 Motif for Unix
 
 #include <X11/keysym.h>
diff --git a/Common/Message.h b/Common/Message.h
index 6c840af6598dc02bfe396c3ba9555a6db344aa03..ee86ad9bfef492861c33b9e7d7a73de102456ac8 100644
--- a/Common/Message.h
+++ b/Common/Message.h
@@ -4,7 +4,7 @@
 #include <stdarg.h>
 
 #define FATAL          0  // Fatal error (causes Gmsh to exit)
-#define ERROR          1  // Error (but Gmsh can live with it)
+#define GERROR         1  // Error (but Gmsh can live with it)
 #define WARNING        2  // Warning
 #define INFOS          3  // Long informations
 #define INFO           4  // Small information in status bar
diff --git a/Common/Timer.cpp b/Common/Timer.cpp
index f1794a0e2fc6b642ca95b8472245274230342eab..b9e49823e7c25fccb0ff1f2eac168714718afa23 100644
--- a/Common/Timer.cpp
+++ b/Common/Timer.cpp
@@ -1,9 +1,13 @@
+#ifndef WIN32
 #include <sys/time.h>
 #include <unistd.h>
-
 long GetTime(){
   struct timeval tp;
   gettimeofday(&tp, (struct timezone *) 0);
   return (long)tp.tv_sec * 1000000 + (long)tp.tv_usec;
 }
-
+#else
+long GetTime(){
+	return 0;
+}
+#endif
diff --git a/Common/Views.cpp b/Common/Views.cpp
index 03e9ad84e27546d89ca0280124f053826a53e3bf..872aa8bb83e4f73141cdfb55cf5317e6e8b9e6ee 100644
--- a/Common/Views.cpp
+++ b/Common/Views.cpp
@@ -1,4 +1,4 @@
-// $Id: Views.cpp,v 1.21 2001-01-08 08:05:40 geuzaine Exp $
+// $Id: Views.cpp,v 1.22 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Views.h"
@@ -148,14 +148,14 @@ void Stat_VectorSimplex(int nbnod, int N, double *V){
 }
 
 void Stat_TensorSimplex(int nbnod, int N, double *v){
-  Msg(ERROR, "Tensor Field Views not Implemented Yet");
+  Msg(GERROR, "Tensor Field Views not Implemented Yet");
 }
 
 void EndView(int AddInUI, int Number, char *FileName, char *Name, 
              double XOffset, double YOffset, double ZOffset){
   int i, nb;
   double d;
-  extern void AddViewInUI(int , char *, int);
+  extern int AddViewInUI(int , char *, int);
 
   // Points
 
@@ -491,7 +491,7 @@ void Read_View(FILE *file, char *filename){
     if (!strncmp(&str[1], "PostFormat", 10)){
       fscanf(file, "%lf %d %d\n", &version, &format, &size) ;
       if(version < 1.0){
-        Msg(ERROR, "The Version of this File is too old (%g < 1.0)", version);
+        Msg(GERROR, "The Version of this File is too old (%g < 1.0)", version);
         return;
       }
       if(size == sizeof(double))
@@ -499,7 +499,7 @@ void Read_View(FILE *file, char *filename){
       else if(size == sizeof(float))
 	Msg(DEBUG, "Data is in Single Precision Format (size==%d)", size);
       else{
-        Msg(ERROR, "Unknown Type of Data (Size = %d) in Post-Processing File", 
+        Msg(GERROR, "Unknown Type of Data (Size = %d) in Post-Processing File", 
 	    size);
         return;
       }
@@ -508,7 +508,7 @@ void Read_View(FILE *file, char *filename){
       else if(format == 1)
 	format = LIST_FORMAT_BINARY ;
       else{
-	Msg(ERROR, "Unknown Format for View");
+	Msg(GERROR, "Unknown Format for View");
 	return ;
       }
     }
@@ -598,7 +598,7 @@ void Read_View(FILE *file, char *filename){
 
     do {
       fgets(str, NAME_STR_L, file) ;
-      if (feof(file)) Msg(ERROR,"Prematured End of File");
+      if (feof(file)) Msg(GERROR,"Prematured End of File");
     } while (str[0] != '$') ;
 
   }   /* while 1 ... */
diff --git a/DataStr/List.cpp b/DataStr/List.cpp
index 05737f288a10ea24afa3eb8c004c5e6ad43efc65..46138095c8847c5ed99909d8078bef41ae5b634c 100644
--- a/DataStr/List.cpp
+++ b/DataStr/List.cpp
@@ -1,4 +1,4 @@
-// $Id: List.cpp,v 1.12 2001-01-08 08:05:40 geuzaine Exp $
+// $Id: List.cpp,v 1.13 2001-01-09 19:40:56 remacle Exp $
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -104,7 +104,7 @@ void List_Read(List_T *liste, int index, void *data)
 void List_Write(List_T *liste, int index, void *data)
 {
   if ((index < 0) || (index >= liste->n))
-    Msg(ERROR, "Wrong List Index in List_Write");
+    Msg(GERROR, "Wrong List Index in List_Write");
   else{
     liste->isorder = 0;
     memcpy(&liste->array[index * liste->size],data,liste->size);
@@ -114,7 +114,7 @@ void List_Write(List_T *liste, int index, void *data)
 void List_Put(List_T *liste, int index, void *data)
 {
   if (index < 0)
-    Msg(ERROR, "Wrong List Index in List_Put");
+    Msg(GERROR, "Wrong List Index in List_Put");
   else{
     if (index >= liste->n) {
       liste->n = index + 1;
@@ -383,7 +383,7 @@ List_T *List_CreateFromFile(int n, int size, FILE *file, int format, int swap){
     else if(size == sizeof(int))
       for(i=0;i<n;i++) fscanf(file, "%d", (int*)&liste->array[i*size]) ;
     else{
-      Msg(ERROR, "Unknown Type of Data to Create List From");
+      Msg(GERROR, "Unknown Type of Data to Create List From");
       return NULL;
     }
     return liste;
@@ -392,7 +392,7 @@ List_T *List_CreateFromFile(int n, int size, FILE *file, int format, int swap){
     if(swap) swap_bytes(liste->array, size, n);
     return liste;
   default :
-    Msg(ERROR, "Unknown List Format");
+    Msg(GERROR, "Unknown List Format");
     return NULL;
   }
 
@@ -412,13 +412,13 @@ void List_WriteToFile(List_T *liste, FILE *file, int format){
     else if(liste->size == sizeof(int))
       for(i=0;i<n;i++) fprintf(file, "%d ", *((int*)&liste->array[i*liste->size])) ;
     else
-      Msg(ERROR, "Unknown Type of Data to Write List to File");
+      Msg(GERROR, "Unknown Type of Data to Write List to File");
     fprintf(file, "\n");
     break;
   case LIST_FORMAT_BINARY :
     fwrite(liste->array, liste->size, n, file);
     break;
   default :
-    Msg(ERROR, "Unknown List Format");
+    Msg(GERROR, "Unknown List Format");
   }
 }
diff --git a/DataStr/Tree.cpp b/DataStr/Tree.cpp
index e36eccc5d849318e1de6295d71b47e9feb4e30aa..ad2c5ebc7b7dd23d838a5e321de333f90a3d6264 100644
--- a/DataStr/Tree.cpp
+++ b/DataStr/Tree.cpp
@@ -1,4 +1,4 @@
-// $Id: Tree.cpp,v 1.5 2001-01-08 08:05:41 geuzaine Exp $
+// $Id: Tree.cpp,v 1.6 2001-01-09 19:40:56 remacle Exp $
 
 #include <stdlib.h>
 #include <string.h>
@@ -31,7 +31,7 @@ void Tree_Add(Tree_T *tree, void *data)
   void *ptr;
 
   if(!tree) 
-    Msg(ERROR, "Impossible to Add in Unallocated Tree");
+    Msg(GERROR, "Impossible to Add in Unallocated Tree");
   else{
     ptr = Malloc(tree->size);
     memcpy(ptr,data,tree->size);
@@ -69,7 +69,7 @@ int Tree_Replace(Tree_T *tree, void *data)
   int state;
 
   if(!tree) {
-    Msg(ERROR, "Impossible to Replace in Unallocated Tree");
+    Msg(GERROR, "Impossible to Replace in Unallocated Tree");
     return(0);
   }
   state = avl_lookup(tree->root, data, &ptr);
diff --git a/Fltk/GUI.cpp b/Fltk/GUI.cpp
index a1385face27ffa2585cde7e5cada538994d22c86..2c3d165f15186bcd6a40dc192b889948d7bbecce 100644
--- a/Fltk/GUI.cpp
+++ b/Fltk/GUI.cpp
@@ -413,6 +413,8 @@ void GUI::set_status(char *msg, int num){
 
 // Set the statistics
 void GUI::set_statistics(){
+
+  int i;	
   static double  s[50];
   static char    label[50][256];
 
@@ -448,7 +450,7 @@ void GUI::set_statistics(){
   sprintf(label[18], "%g", s[15]);   stat_value[18]->value(label[18]);
 
   s[16] = s[17] = s[18] = s[19] = 0 ;
-  for(int i=0 ; i<List_Nbr(Post_ViewList) ; i++){
+  for(i=0 ; i<List_Nbr(Post_ViewList) ; i++){
     Post_View *v = (Post_View*)List_Pointer(Post_ViewList, i);
     if(v->Visible){
       s[16] += v->NbSP + v->NbVP + v->NbTP;
@@ -462,7 +464,7 @@ void GUI::set_statistics(){
   sprintf(label[21], "%g", s[18]); stat_value[21]->value(label[21]);
   sprintf(label[22], "%g", s[19]); stat_value[22]->value(label[22]);
 
-  for(int i=0 ; i<23 ; i++)
+  for(i=0 ; i<23 ; i++)
     stat_value[16]->redraw();
 
 }
@@ -738,6 +740,7 @@ void GUI::create_general_options_window(){
 
 void GUI::create_geometry_options_window(){
   static int init_opt_geometry = 0;
+  int i;
 
   if(!init_opt_geometry){
     init_opt_geometry = 1 ;
@@ -777,7 +780,7 @@ void GUI::create_geometry_options_window(){
         geo_butt[7] = new Fl_Check_Button(2*WB+120, 2*WB+4*BH, 100, BH, "Volume numbers");
 	geo_butt[7]->callback(opt_geometry_num_cb, (void*)3);
 	geo_butt[7]->value(CTX.geom.volumes_num);
-	for(int i=0 ; i<8 ; i++){
+	for(i=0 ; i<8 ; i++){
 	  geo_butt[i]->type(FL_TOGGLE_BUTTON);
 	  geo_butt[i]->down_box(FL_DOWN_BOX);
 	  geo_butt[i]->labelsize(CTX.fontsize);
@@ -802,7 +805,7 @@ void GUI::create_geometry_options_window(){
 	geo_value[1]->step(0.1);
 	geo_value[1]->callback(opt_geometry_tangents_cb);
 	geo_value[1]->value(CTX.mesh.tangents);
-	for(int i=0 ; i<2 ; i++){
+	for(i=0 ; i<2 ; i++){
 	  geo_value[i]->labelsize(CTX.fontsize);
 	  geo_value[i]->type(FL_HORIZONTAL);
 	  geo_value[i]->align(FL_ALIGN_RIGHT);
@@ -840,6 +843,7 @@ void GUI::create_geometry_options_window(){
 
 void GUI::create_mesh_options_window(){
   static int init_opt_mesh = 0;
+  int i;
 
   if(!init_opt_mesh){
     init_opt_mesh = 1 ;
@@ -865,7 +869,7 @@ void GUI::create_mesh_options_window(){
         mesh_butt[2] = new Fl_Check_Button(2*WB, 2*WB+3*BH, 100, BH, "Anisotropic");
 	mesh_butt[2]->callback(opt_mesh_algo_cb, (void*)0);
 	mesh_butt[2]->value(CTX.mesh.algo==DELAUNAY_NEWALGO);
-	for(int i=0 ; i<3 ; i++){
+	for(i=0 ; i<3 ; i++){
 	  mesh_butt[i]->type(FL_TOGGLE_BUTTON);
 	  mesh_butt[i]->down_box(FL_DOWN_BOX);
 	  mesh_butt[i]->labelsize(CTX.fontsize);
@@ -910,7 +914,7 @@ void GUI::create_mesh_options_window(){
         mesh_butt[10] = new Fl_Check_Button(2*WB+120, 2*WB+4*BH, 100, BH, "Volume Numbers");
 	mesh_butt[10]->callback(opt_mesh_entity_cb, (void*)3);
 	mesh_butt[10]->value(CTX.mesh.volumes_num);
-	for(int i=3 ; i<11 ; i++){
+	for(i=3 ; i<11 ; i++){
 	  mesh_butt[i]->type(FL_TOGGLE_BUTTON);
 	  mesh_butt[i]->down_box(FL_DOWN_BOX);
 	  mesh_butt[i]->labelsize(CTX.fontsize);
@@ -934,7 +938,7 @@ void GUI::create_mesh_options_window(){
 	mesh_value[2]->step(1);
 	mesh_value[2]->callback(opt_mesh_normals_cb);
 	mesh_value[2]->value(CTX.mesh.normals);
-	for(int i=1 ; i<3 ; i++){
+	for(i=1 ; i<3 ; i++){
 	  mesh_value[i]->labelsize(CTX.fontsize);
 	  mesh_value[i]->type(FL_HORIZONTAL);
 	  mesh_value[i]->align(FL_ALIGN_RIGHT);
@@ -954,7 +958,7 @@ void GUI::create_mesh_options_window(){
         mesh_butt[13] = new Fl_Check_Button(2*WB, 2*WB+3*BH, 100, BH, "Solid");
 	mesh_butt[13]->callback(opt_mesh_aspect_cb, (void*)2);
 	mesh_butt[13]->value(CTX.mesh.shade);
-	for(int i=11 ; i<14 ; i++){
+	for(i=11 ; i<14 ; i++){
 	  mesh_butt[i]->type(FL_RADIO_BUTTON);
 	  mesh_butt[i]->down_box(FL_DOWN_BOX);
 	  mesh_butt[i]->labelsize(CTX.fontsize);
@@ -1265,6 +1269,7 @@ void GUI::create_about_window(){
 
 void GUI::create_view_window(){
   static int init_opt_view = 0;
+  int i;
 
   if(!init_opt_view){
     init_opt_view = 1 ;
@@ -1285,7 +1290,7 @@ void GUI::create_view_window(){
         view_butt[0] = new Fl_Check_Button(2*WB, 2*WB+BH, 100, BH, "Show color bar");
         view_butt[1] = new Fl_Check_Button(2*WB, 2*WB+2*BH, 100, BH, "Display time");
         view_butt[2] = new Fl_Check_Button(2*WB, 2*WB+3*BH, 100, BH, "Transparent bar");
-	for(int i=0 ; i<3 ; i++){
+	for(i=0 ; i<3 ; i++){
 	  view_butt[i]->type(FL_TOGGLE_BUTTON);
 	  view_butt[i]->down_box(FL_DOWN_BOX);
 	  view_butt[i]->labelsize(CTX.fontsize);
@@ -1293,7 +1298,7 @@ void GUI::create_view_window(){
 	}
 	view_input[0] = new Fl_Input (2*WB, 2*WB+4*BH, IW, BH, "Title");
 	view_input[1] = new Fl_Input (2*WB, 2*WB+5*BH, IW, BH, "Format");
-	for(int i=0 ; i<2 ; i++){
+	for(i=0 ; i<2 ; i++){
 	  view_input[i]->labelsize(CTX.fontsize);
 	  view_input[i]->type(FL_HORIZONTAL);
 	  view_input[i]->align(FL_ALIGN_RIGHT);
@@ -1313,14 +1318,14 @@ void GUI::create_view_window(){
 
         view_value[0] = new Fl_Value_Input(2*WB, 2*WB+2*BH, IW, BH, "Min");
         view_value[1] = new Fl_Value_Input(2*WB, 2*WB+3*BH, IW, BH, "Max");
-	for(int i=0 ; i<2 ; i++){
+	for(i=0 ; i<2 ; i++){
 	  view_value[i]->labelsize(CTX.fontsize);
 	  view_value[i]->type(FL_HORIZONTAL);
 	  view_value[i]->align(FL_ALIGN_RIGHT);
 	}
 	view_butt[4] = new Fl_Check_Button(2*WB, 2*WB+4*BH, 100, BH, "Linear");
 	view_butt[5] = new Fl_Check_Button(2*WB, 2*WB+5*BH, 100, BH, "Logarithmic");
-	for(int i=4 ; i<6 ; i++){
+	for(i=4 ; i<6 ; i++){
 	  view_butt[i]->type(FL_RADIO_BUTTON);
 	  view_butt[i]->labelsize(CTX.fontsize);
 	  view_butt[i]->selection_color(FL_YELLOW);
@@ -1343,7 +1348,7 @@ void GUI::create_view_window(){
 	view_butt[7] = new Fl_Check_Button(2*WB, 2*WB+3*BH, 100, BH, "Filled iso-values");
 	view_butt[8] = new Fl_Check_Button(2*WB, 2*WB+4*BH, 100, BH, "Continuous map");
 	view_butt[9] = new Fl_Check_Button(2*WB, 2*WB+5*BH, 100, BH, "Numeric values");
-	for(int i=6 ; i<10 ; i++){
+	for(i=6 ; i<10 ; i++){
 	  view_butt[i]->type(FL_RADIO_BUTTON);
 	  view_butt[i]->labelsize(CTX.fontsize);
 	  view_butt[i]->selection_color(FL_YELLOW);
@@ -1358,7 +1363,7 @@ void GUI::create_view_window(){
 	view_value[3] = new Fl_Value_Input(2*WB, 2*WB+ BH, IW, BH, "X offset");
         view_value[4] = new Fl_Value_Input(2*WB, 2*WB+2*BH, IW, BH, "Y offset");
 	view_value[5] = new Fl_Value_Input(2*WB, 2*WB+3*BH, IW, BH, "Z offset");
-	for(int i=3 ; i<6 ; i++){
+	for(i=3 ; i<6 ; i++){
 	  view_value[i]->labelsize(CTX.fontsize);
 	  view_value[i]->type(FL_HORIZONTAL);
 	  view_value[i]->align(FL_ALIGN_RIGHT);
@@ -1373,7 +1378,7 @@ void GUI::create_view_window(){
 	view_value[6] = new Fl_Value_Input(2*WB, 2*WB+ BH, IW, BH, "X raise");
         view_value[7] = new Fl_Value_Input(2*WB, 2*WB+2*BH, IW, BH, "Y raise");
 	view_value[8] = new Fl_Value_Input(2*WB, 2*WB+3*BH, IW, BH, "Z raise");
-	for(int i=6 ; i<9 ; i++){
+	for(i=6 ; i<9 ; i++){
 	  view_value[i]->labelsize(CTX.fontsize);
 	  view_value[i]->type(FL_HORIZONTAL);
 	  view_value[i]->align(FL_ALIGN_RIGHT);
diff --git a/Fltk/Message.cpp b/Fltk/Message.cpp
index cde787be9a86d7e772d297a732075b363c7df013..c052ffa7c19ac4e42ac1db6803a0c3284a1a76de 100644
--- a/Fltk/Message.cpp
+++ b/Fltk/Message.cpp
@@ -1,7 +1,9 @@
-// $Id: Message.cpp,v 1.2 2001-01-09 09:52:16 geuzaine Exp $
+// $Id: Message.cpp,v 1.3 2001-01-09 19:40:56 remacle Exp $
 
 #include <signal.h>
+#ifndef WIN32
 #include <sys/resource.h>
+#endif
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -64,7 +66,7 @@ void Msg(int level, char *fmt, ...){
     fprintf(stderr, "\n");
     abort = 1; 
     break;
-  case ERROR :
+  case GERROR :
     if(CTX.interactive || !CTX.command_win){
       fprintf(stderr, ERROR_STR);
       vfprintf(stderr, fmt, args); 
@@ -190,12 +192,17 @@ void Msg(int level, char *fmt, ...){
 /* ------------------------------------------------------------------------ */
 
 void GetResources(long *s, long *us, long *mem){
+#ifndef WIN32
   static struct rusage r;
 
   getrusage(RUSAGE_SELF,&r);
   *s   = (long)r.ru_utime.tv_sec ;
   *us  = (long)r.ru_utime.tv_usec ;
   *mem = (long)r.ru_maxrss ;
+#else
+  *s = *us = *mem = 0;
+#endif
+
 }
 
 void PrintResources(FILE *stream, char *fmt, long s, long us, long mem){
diff --git a/Geo/CAD.cpp b/Geo/CAD.cpp
index ad7080c836eb7cf35d29a884db3a76a1fc81c19d..7a55ee9d5448f0063457326d24e00fe81f50853e 100644
--- a/Geo/CAD.cpp
+++ b/Geo/CAD.cpp
@@ -1,4 +1,4 @@
-// $Id: CAD.cpp,v 1.13 2001-01-08 08:05:42 geuzaine Exp $
+// $Id: CAD.cpp,v 1.14 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Geo.h"
@@ -1424,7 +1424,7 @@ void ApplicationOnShapes(double matrix[4][4], List_T *ListShapes){
       ApplicationOnSurface(O.Num,matrix);
       break;
     default:
-      Msg(ERROR, "Impossible to Translate Entity %d (of Type %d)", 
+      Msg(GERROR, "Impossible to Translate Entity %d (of Type %d)", 
           O.Num, O.Type);
       break;
     }
@@ -1509,7 +1509,7 @@ void CopyShape(int Type, int Num, int *New){
     *New = news->Num;
     break;
   default:
-    Msg(ERROR, "Impossible to Copy the Entity %d (of Type %d)", Num, Type);
+    Msg(GERROR, "Impossible to Copy the Entity %d (of Type %d)", Num, Type);
     break;
   }
 }
@@ -1585,7 +1585,7 @@ void DeleteShape(int Type, int Num){
     DeleteSurf(Num);
     break;
   default:
-    Msg(ERROR, "Impossible to Delete the Entity %d (of Type %d)", Num, Type);
+    Msg(GERROR, "Impossible to Delete the Entity %d (of Type %d)", Num, Type);
     break;
   }
 }
diff --git a/Geo/Geo.cpp b/Geo/Geo.cpp
index 50905a371e2eb325fdbd32c48f1a58d23cdcb623..3cd85f660c2210adc909b5ec254b08dcb02c9502 100644
--- a/Geo/Geo.cpp
+++ b/Geo/Geo.cpp
@@ -1,4 +1,4 @@
-// $Id: Geo.cpp,v 1.12 2001-01-08 08:05:42 geuzaine Exp $
+// $Id: Geo.cpp,v 1.13 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Const.h"
@@ -31,7 +31,7 @@ double evaluate_scalarfunction (char *var, double val, char *funct){
   tempf = yyin;
   
   if(!(yyin = fopen("gmsh.tmp","w"))){
-    Msg(ERROR, "Unable to Open Temporary File");
+    Msg(GERROR, "Unable to Open Temporary File");
     return 0.;
   }
 
@@ -61,11 +61,11 @@ void add_infile(char *text, char *fich){
   FILE *file;
 
   if(!(yyin = fopen("gmsh.tmp","w"))){
-    Msg(ERROR, "Unable to Open Temporary File");
+    Msg(GERROR, "Unable to Open Temporary File");
     return;
   }
   if(!(file = fopen(fich,"a"))){
-    Msg(ERROR, "Unable to Open File '%s'", fich);
+    Msg(GERROR, "Unable to Open File '%s'", fich);
     return;
   }
   fprintf(yyin,"%s\n",text);
diff --git a/Geo/Print_Geo.cpp b/Geo/Print_Geo.cpp
index 5e3e856e441d677062d35d8dd0d2159ce08d3fc4..9c8bda1755d9b124f4c02775a3ff8d5684ff6468 100644
--- a/Geo/Print_Geo.cpp
+++ b/Geo/Print_Geo.cpp
@@ -1,4 +1,4 @@
-// $Id: Print_Geo.cpp,v 1.11 2001-01-08 08:05:43 geuzaine Exp $
+// $Id: Print_Geo.cpp,v 1.12 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Geo.h"
@@ -67,7 +67,7 @@ void Print_Curve(void *a, void *b){
     fprintf(FOUT,"CatmullRom (%d) = ",c->Num);
     break;
   default:
-    Msg(ERROR, "Unknown Curve Type %d", c->Typ);
+    Msg(GERROR, "Unknown Curve Type %d", c->Typ);
     return;
   }
   
diff --git a/Graphics/Axes.cpp b/Graphics/Axes.cpp
index 59e2a30be74f33d7d231211c9bde1c395e2e582a..a8206b289bfddaf13846a703a8018be192ebc42b 100644
--- a/Graphics/Axes.cpp
+++ b/Graphics/Axes.cpp
@@ -1,5 +1,4 @@
-// $Id: Axes.cpp,v 1.2 2001-01-08 08:05:43 geuzaine Exp $
-
+// $Id: Axes.cpp,v 1.3 2001-01-09 19:40:56 remacle Exp $
 #include "Gmsh.h"
 #include "GmshUI.h"
 #include "Const.h"
diff --git a/Graphics/CreateFile.cpp b/Graphics/CreateFile.cpp
index b2eac41112217a1624e35d3358b9780075b07e38..5108cc81d854aa9a388f09b4761d8369a798e9fa 100644
--- a/Graphics/CreateFile.cpp
+++ b/Graphics/CreateFile.cpp
@@ -1,4 +1,4 @@
-// $Id: CreateFile.cpp,v 1.3 2001-01-09 13:28:46 geuzaine Exp $
+// $Id: CreateFile.cpp,v 1.4 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "GmshUI.h"
@@ -45,7 +45,7 @@ void CreateFile (char *name, int format) {
 
   case FORMAT_AUTO :
     if(strlen(name) < 4)
-      Msg(ERROR, "Unknown Extension for Automatic Format Detection");
+      Msg(GERROR, "Unknown Extension for Automatic Format Detection");
     else{
       strcpy(ext,name+(strlen(name)-4));
       if(!strcmp(ext,".geo")) CreateFile(name, FORMAT_GEO);
@@ -59,7 +59,7 @@ void CreateFile (char *name, int format) {
       else if(!strcmp(ext,".yuv")) CreateFile(name, FORMAT_YUV);
       else {
 	if(strlen(name) < 5)
-	  Msg(ERROR, "Unknown Extension for Automatic Format Detection");
+	  Msg(GERROR, "Unknown Extension for Automatic Format Detection");
 	else{
 	  strcpy(ext,name+(strlen(name)-5));
 	  if(!strcmp(ext,".jpeg")) CreateFile(name, FORMAT_JPEG);
@@ -101,7 +101,7 @@ void CreateFile (char *name, int format) {
     break;
 
 #endif
-
+#ifndef WIN32
   case FORMAT_JPEG :
     if(!(fp = fopen(name,"wb"))) {
       Msg(WARNING, "Unable to Open File '%s'", name); 
@@ -115,7 +115,7 @@ void CreateFile (char *name, int format) {
     Msg (INFO, "Wrote File '%s'", name);
     fclose(fp);
     break;
-
+#endif
   case FORMAT_GIF :
     if(!(fp = fopen(name,"wb"))) {
       Msg(WARNING, "Unable to Open File '%s'", name); 
diff --git a/Graphics/XDump.cpp b/Graphics/XDump.cpp
index d09e0f9f618c16c0a8977479c644d34e265c3182..c8ad9ca1f72f476661c6e25ccc6533e90dc7b753 100644
--- a/Graphics/XDump.cpp
+++ b/Graphics/XDump.cpp
@@ -1,4 +1,4 @@
-// $Id: XDump.cpp,v 1.2 2001-01-08 08:05:43 geuzaine Exp $
+// $Id: XDump.cpp,v 1.3 2001-01-09 19:40:56 remacle Exp $
 
 /* This is a modified version for Gmsh (mainly for c++ compliance) */
 
@@ -55,6 +55,12 @@
  * systems, sizeof(XColor)=16.  We MUST have an XColor struct of size
  * 12 so a correct file is written.  BEP July-21-95
  */
+
+#ifdef WIN32
+
+#else
+
+
 typedef struct {
         unsigned int /*long*/ pixel;
         unsigned short red, green, blue;
@@ -449,3 +455,4 @@ void Window_Dump(Display *display, int scr, Window window, FILE *out){
      */
     XDestroyImage(image);
 }
+#endif
\ No newline at end of file
diff --git a/Graphics/gl2ps.cpp b/Graphics/gl2ps.cpp
index 795f775d120fd1a716d5820d3450fe3c2477608f..6ba759058435be0a96d7305397090aac17d25573 100644
--- a/Graphics/gl2ps.cpp
+++ b/Graphics/gl2ps.cpp
@@ -1,4 +1,4 @@
-// $Id: gl2ps.cpp,v 1.5 2001-01-08 08:05:44 geuzaine Exp $
+// $Id: gl2ps.cpp,v 1.6 2001-01-09 19:40:56 remacle Exp $
 
 /*
  * GL2PS, an OpenGL to Postscript Printing Library, version 0.31
@@ -24,7 +24,9 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  */
-
+#ifdef WIN32
+#include <windows.h>
+#endif
 #include <string.h>
 #include <sys/types.h>
 #include <malloc.h>
diff --git a/Mesh/2D_BGMesh.cpp b/Mesh/2D_BGMesh.cpp
index 8547833db5cc92d8adfde8fa2c540a54fc2db9ed..446300dd97320b8303b2abb8d43a64088fa59d74 100644
--- a/Mesh/2D_BGMesh.cpp
+++ b/Mesh/2D_BGMesh.cpp
@@ -1,4 +1,4 @@
-// $Id: 2D_BGMesh.cpp,v 1.5 2001-01-08 08:05:44 geuzaine Exp $
+// $Id: 2D_BGMesh.cpp,v 1.6 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Const.h"
@@ -20,7 +20,7 @@ double find_quality (MPoint center, DocRecord * BGMESH){
   double Exp = 2., r, deno, nume;
 
   if ((del = Find_Triangle (center, BGMESH, BOF)) == NULL){
-    Msg(ERROR, "Exterior Point (%g,%g)", center.v, center.h);
+    Msg(GERROR, "Exterior Point (%g,%g)", center.v, center.h);
     return 1.e-15;
   }
 
diff --git a/Mesh/2D_Bowyer.cpp b/Mesh/2D_Bowyer.cpp
index 817dc19b61c154825e4f476421f8c27fd3ab75d5..c9a6b8bd77bdd53546e23dac863bb2dda3d080fb 100644
--- a/Mesh/2D_Bowyer.cpp
+++ b/Mesh/2D_Bowyer.cpp
@@ -1,4 +1,4 @@
-// $Id: 2D_Bowyer.cpp,v 1.5 2001-01-08 08:05:44 geuzaine Exp $
+// $Id: 2D_Bowyer.cpp,v 1.6 2001-01-09 19:40:56 remacle Exp $
 
 /*
 
@@ -88,7 +88,7 @@ int PE_Del_Triangle (Delaunay *del , MPoint pt, DListPeek *ListEdges ,
       rslt &= DListInsert(ListEdges,pt,b);
       rslt &= DListInsert(ListEdges,pt,c);
       if(!rslt)
-        Msg(ERROR, "List Insert Failed in Boyer Watson"); 
+        Msg(GERROR, "List Insert Failed in Boyer Watson"); 
       
     }
     else { 
@@ -148,21 +148,21 @@ int PE_Del_Triangle (Delaunay *del , MPoint pt, DListPeek *ListEdges ,
         else if (de1->v.voisin2 == del )de1->v.voisin2 = NULL;
       else if (de1->v.voisin3 == del )de1->v.voisin3 = NULL;
       else
-        Msg(ERROR, "Bad Link in Boyer Watson"); 
+        Msg(GERROR, "Bad Link in Boyer Watson"); 
     }
     if(de2 != NULL){
       if (de2->v.voisin1 == del )de2->v.voisin1 = NULL;
       else if (de2->v.voisin2 == del )de2->v.voisin2 = NULL;
       else if (de2->v.voisin3 == del )de2->v.voisin3 = NULL;
       else
-        Msg(ERROR, "Bad Link in Boyer Watson"); 
+        Msg(GERROR, "Bad Link in Boyer Watson"); 
     }      
     if(de3 != NULL){
       if (de3->v.voisin1 == del )de3->v.voisin1 = NULL;
       else if (de3->v.voisin2 == del )de3->v.voisin2 = NULL;
       else if (de3->v.voisin3 == del )de3->v.voisin3 = NULL;
       else
-        Msg(ERROR, "Bad Link in Boyer Watson");
+        Msg(GERROR, "Bad Link in Boyer Watson");
     }      
     
     del->v.voisin1 = NULL ;
diff --git a/Mesh/2D_DivAndConq.cpp b/Mesh/2D_DivAndConq.cpp
index dc502a44d93d711acafb9c95cfdaccbe40bcee4d..9727e6a5f3e15968e90bf4eb7b5d41d8cc19987d 100644
--- a/Mesh/2D_DivAndConq.cpp
+++ b/Mesh/2D_DivAndConq.cpp
@@ -1,4 +1,4 @@
-// $Id: 2D_DivAndConq.cpp,v 1.8 2001-01-08 08:05:44 geuzaine Exp $
+// $Id: 2D_DivAndConq.cpp,v 1.9 2001-01-09 19:40:56 remacle Exp $
 
 /*
 
@@ -162,7 +162,7 @@ int Qtest(PointNumero h,PointNumero i,PointNumero j,PointNumero k){
   double xc,yc,rcarre,distca;
   
   if ((h == i) && (h == j) && (h == k)){
-    Msg(ERROR, "3 Points Identical in Qtest"); 
+    Msg(GERROR, "3 Points Identical in Qtest"); 
     return(0);  /* returning 1 will cause looping for ever */
   }
   if (CircumCircle( (double) pPointArray[h].where.h,
diff --git a/Mesh/2D_Links.cpp b/Mesh/2D_Links.cpp
index 09b77d25baf17855d2108fefcbf65a6f93a28ba6..165b72e02ef8aeee93ffd76fca626bfe930ac08a 100644
--- a/Mesh/2D_Links.cpp
+++ b/Mesh/2D_Links.cpp
@@ -1,4 +1,4 @@
-// $Id: 2D_Links.cpp,v 1.5 2001-01-08 08:05:44 geuzaine Exp $
+// $Id: 2D_Links.cpp,v 1.6 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Const.h"
@@ -197,7 +197,7 @@ int CreateLinks(List_T * ListDelaunay , int NumDelaunay,
         else if (del_Pi->v.voisin3 == NULL)
           del_Pi->v.voisin3 = del_Pj;
         else
-          Msg(ERROR, "Bad Link in CreateLinks"); 
+          Msg(GERROR, "Bad Link in CreateLinks"); 
 
         if (del_Pj->v.voisin1 == NULL)
           del_Pj->v.voisin1 = del_Pi;
@@ -206,7 +206,7 @@ int CreateLinks(List_T * ListDelaunay , int NumDelaunay,
         else if (del_Pj->v.voisin3 == NULL)
           del_Pj->v.voisin3 = del_Pi;
         else
-          Msg(ERROR, "Bad Link in CreateLinks"); 
+          Msg(GERROR, "Bad Link in CreateLinks"); 
       }
       i+=2;
     }
diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp
index aa208bab6eedb1b6d6b6d2af95ae7623c94eaba7..825e2a844ed243451342751457eff22ab0cba59f 100644
--- a/Mesh/2D_Mesh.cpp
+++ b/Mesh/2D_Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: 2D_Mesh.cpp,v 1.14 2001-01-08 08:05:44 geuzaine Exp $
+// $Id: 2D_Mesh.cpp,v 1.15 2001-01-09 19:40:56 remacle Exp $
 
 /*
    Maillage Delaunay d'une surface (Point insertion Technique)
@@ -218,7 +218,7 @@ void Plan_Moyen (void *data, void *dum){
           Msg(DEBUG, "Mean Plane of Type 'ax + by = -z'");
         }
         else{
-          Msg(ERROR, "Problem in Mean Plane");
+          Msg(GERROR, "Problem in Mean Plane");
         }
       }
     }
@@ -470,7 +470,7 @@ int mesh_domain (ContourPeek * ListContours, int numcontours,
   mai->numpoints = 0;
 
   if (!numcontours){
-    Msg(ERROR, "No Contour");
+    Msg(GERROR, "No Contour");
     return 0;
   }
 
@@ -916,7 +916,7 @@ void Maillage_Automatique_VieuxCode (Surface * pS, Mesh * m, int ori){
       }
       else{
         err = 1;
-        Msg(ERROR, "Unknown Vertex %d", ver[j]->Num);
+        Msg(GERROR, "Unknown Vertex %d", ver[j]->Num);
       }
     }
     if (ori && !err)
diff --git a/Mesh/2D_Mesh_Aniso.cpp b/Mesh/2D_Mesh_Aniso.cpp
index 2e09e655b22c8e3561c234a514fac81f2c1af097..b1612c1b6fbeb85da3e50c488e905d6cdba409af 100644
--- a/Mesh/2D_Mesh_Aniso.cpp
+++ b/Mesh/2D_Mesh_Aniso.cpp
@@ -1,4 +1,4 @@
-// $Id: 2D_Mesh_Aniso.cpp,v 1.9 2001-01-08 08:05:44 geuzaine Exp $
+// $Id: 2D_Mesh_Aniso.cpp,v 1.10 2001-01-09 19:40:56 remacle Exp $
 
 /*
    Jean-Francois Remacle
@@ -459,7 +459,7 @@ void CrSi_2D (void *a, void *b){
     List_Add (Simplexes_New, &s);
   }
   else if (S->NumFaceSimpl != 2){
-    Msg(ERROR, "Panic in CrSi_2D...");
+    Msg(GERROR, "Panic in CrSi_2D...");
   }
 }
 
@@ -677,7 +677,7 @@ void Convex_Hull_Mesh_2D (List_T * Points, Surface * s){
       } 
     */
     if (!THES){
-      Msg(ERROR, "Vertex (%g,%g,%g) in no Simplex",
+      Msg(GERROR, "Vertex (%g,%g,%g) in no Simplex",
           THEV->Pos.X, THEV->Pos.Y, THEV->Pos.Z);
       THEV->Pos.X += CTX.mesh.rand_factor * LC2D * rand()/RAND_MAX;
       THEV->Pos.Y += CTX.mesh.rand_factor * LC2D * rand()/RAND_MAX;
diff --git a/Mesh/2D_Util.cpp b/Mesh/2D_Util.cpp
index 4c607476a20eb3e63fd4218e8e0411844617b040..aeade8cbf6d562eda4a8614847f4398bd1576f11 100644
--- a/Mesh/2D_Util.cpp
+++ b/Mesh/2D_Util.cpp
@@ -1,4 +1,4 @@
-// $Id: 2D_Util.cpp,v 1.7 2001-01-08 08:05:44 geuzaine Exp $
+// $Id: 2D_Util.cpp,v 1.8 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Const.h"
@@ -231,7 +231,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) {
           b = del->t.b;
         }
         else{
-          Msg(ERROR, "Voronoi Insert 1"); 
+          Msg(GERROR, "Voronoi Insert 1"); 
         }
       }      
       else if(v2 != NULL) {     
@@ -248,7 +248,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) {
           b = del->t.c;
         }
         else {
-          Msg(ERROR,"Voronoi Insert 2"); 
+          Msg(GERROR,"Voronoi Insert 2"); 
         }
       }      
       else if(v3 != NULL) {     
@@ -265,7 +265,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) {
           b = del->t.c;
         }
         else {
-          Msg(ERROR, "Voronoi Insert 3"); 
+          Msg(GERROR, "Voronoi Insert 3"); 
         }
       }
     }    
@@ -274,7 +274,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) {
       else if( v2->t.position == ACCEPTED )del2 = v2;
       else if( v3->t.position == ACCEPTED )del2 = v3;
       else {
-        Msg(ERROR,"Coherence in Localize"); 
+        Msg(GERROR,"Coherence in Localize"); 
       }
  
       if((del->t.a != del2->t.a) && (del->t.a != del2->t.b) && (del->t.a != del2->t.c)){
@@ -290,7 +290,7 @@ MPoint Localize (Delaunay * del , DocRecord *MESH) {
         b = del->t.b;
       }
       else{
-        Msg(ERROR,"Voronoi Insert"); 
+        Msg(GERROR,"Voronoi Insert"); 
       }
     }
 
diff --git a/Mesh/3D_BGMesh.cpp b/Mesh/3D_BGMesh.cpp
index ba947ca1849a0b61be77acfe1243cc9f8e802213..3f2bc2f695d4068fc21979588904c347c4b20e0b 100644
--- a/Mesh/3D_BGMesh.cpp
+++ b/Mesh/3D_BGMesh.cpp
@@ -1,4 +1,4 @@
-// $Id: 3D_BGMesh.cpp,v 1.13 2001-01-08 08:05:44 geuzaine Exp $
+// $Id: 3D_BGMesh.cpp,v 1.14 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Mesh.h"
@@ -20,7 +20,7 @@ void ExportLcFieldOnVolume (Mesh * M){
   FILE *f = fopen ("OutFile.pos", "w");
 
   if(!f){
-    Msg(ERROR, "Unable to Open File");
+    Msg(GERROR, "Unable to Open File");
     return;
   }
 
@@ -46,7 +46,7 @@ void ExportLcFieldOnSurfaces (Mesh * M){
   FILE *f = fopen ("OutFileS.pos", "w");
 
   if(!f){
-    Msg(ERROR, "Unable to Open File");
+    Msg(GERROR, "Unable to Open File");
     return;
   }
 
@@ -115,7 +115,7 @@ double Lc_XYZ (double X, double Y, double Z, Mesh * m){
     else if (Pt_In_Volume (X, Y, Z, m, &l, 0.2));
     else if (Pt_In_Volume (X, Y, Z, m, &l, 0.5));
     else{
-      Msg(ERROR, "Exterior Point (%g,%g,%g)", X, Y, Z);
+      Msg(GERROR, "Exterior Point (%g,%g,%g)", X, Y, Z);
       l = 1.e-25;
     }
     break;
@@ -342,7 +342,7 @@ int CreateBGM (Post_View * ErrView, int OptiMethod, double Degree,
   f = fopen (OutFile, "w");
 
   if(!f){
-    Msg(ERROR, "Unable to Open File '%s'", OutFile);
+    Msg(GERROR, "Unable to Open File '%s'", OutFile);
     return 0;
   }
 
diff --git a/Mesh/3D_Coherence.cpp b/Mesh/3D_Coherence.cpp
index 7cec4164bb93ca86832e0a7496748e88650d14d5..4f67dbbc6d0057ae381e710c346947e161bccbd8 100644
--- a/Mesh/3D_Coherence.cpp
+++ b/Mesh/3D_Coherence.cpp
@@ -1,4 +1,4 @@
-// $Id: 3D_Coherence.cpp,v 1.10 2001-01-08 08:05:45 geuzaine Exp $
+// $Id: 3D_Coherence.cpp,v 1.11 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Const.h"
@@ -1207,7 +1207,7 @@ int Coherence (Volume * v, Mesh * m){
         pE1->V[0]->Num, pE1->V[1]->Num, List_Nbr(NewPoints));
 
     if (!List_Nbr (NewPoints))
-      Msg(ERROR, "Missing Edge Without Any Intersection (%g,%g,%g) (%g,%g,%g)",
+      Msg(GERROR, "Missing Edge Without Any Intersection (%g,%g,%g) (%g,%g,%g)",
           pE1->V[0]->Pos.X, pE1->V[0]->Pos.Y, pE1->V[0]->Pos.Z,
           pE1->V[1]->Pos.X, pE1->V[1]->Pos.Y, pE1->V[1]->Pos.Z);
     
@@ -1309,7 +1309,7 @@ int Coherence (Volume * v, Mesh * m){
       }
     }
     else{
-      Msg(ERROR, "*Unrecoverable* Face (%d <--> %d=2*(%d-1)-%d)",
+      Msg(GERROR, "*Unrecoverable* Face (%d <--> %d=2*(%d-1)-%d)",
           List_Nbr (ListFaces), 2 * (Np - 1) - Nh, Np, Nh);
       for (k = 0; k < List_Nbr (ListFaces); k++){
         List_Read (ListFaces, k, &Face);
@@ -1337,7 +1337,7 @@ int Coherence (Volume * v, Mesh * m){
   Impression_Resultats ();
 
   if (List_Nbr (MissingFaces) || List_Nbr (MissingEdges)){
-    Msg(ERROR, "Could not Restore all Edges/Faces");
+    Msg(GERROR, "Could not Restore all Edges/Faces");
     return 0;
   }
 
diff --git a/Mesh/3D_Divide.cpp b/Mesh/3D_Divide.cpp
index 7db8a8e1a07ecc4bacae3daa153fd053779362e7..7e15a4211a8d6ed294902b8b2ab6566a44a29909 100644
--- a/Mesh/3D_Divide.cpp
+++ b/Mesh/3D_Divide.cpp
@@ -1,4 +1,4 @@
-// $Id: 3D_Divide.cpp,v 1.7 2001-01-08 08:05:45 geuzaine Exp $
+// $Id: 3D_Divide.cpp,v 1.8 2001-01-09 19:40:56 remacle Exp $
 
 /* Routine de division des elements tetraedriques
    ou triangulaires
@@ -276,7 +276,7 @@ void cut_prism (Vertex * v1, Vertex * v2, Vertex * v3,
     
   }
   else{
-    Msg(ERROR, "Uncoherent Prism");
+    Msg(GERROR, "Uncoherent Prism");
   }
 }
 
@@ -454,7 +454,7 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel,
       v7 = pI->s->V[3];
     }
     else{
-      Msg(ERROR, "Three Edges Cut Without Common Point!");
+      Msg(GERROR, "Three Edges Cut Without Common Point!");
       return;
     }
     
@@ -719,14 +719,14 @@ void cut_tetraedre (Intersection * pI, Tree_T * AddedTet, Tree_T * TetDel,
       v8 = pI->VE[3];
     }
     else{
-      Msg(ERROR, "Incoherent 4 Edges Intersection");
+      Msg(GERROR, "Incoherent 4 Edges Intersection");
       return;
     }
     cut_prism (v8, v4, v6, v7, v3, v5, newpoints, AddedTet);
     cut_prism (v2, v8, v7, v1, v6, v5, newpoints, AddedTet);
   }
   else{
-    Msg(ERROR, "Error On Cut %d %d %d", pI->NbVertex, pI->NbEdge, pI->NbFace);
+    Msg(GERROR, "Error On Cut %d %d %d", pI->NbVertex, pI->NbEdge, pI->NbFace);
   }
 }
 
diff --git a/Mesh/3D_Extrude.cpp b/Mesh/3D_Extrude.cpp
index 1f104d35b996041de2916d5946026015c67c568a..981c87ff37bb629d60ba5b547e7f37676187792d 100644
--- a/Mesh/3D_Extrude.cpp
+++ b/Mesh/3D_Extrude.cpp
@@ -1,4 +1,4 @@
-// $Id: 3D_Extrude.cpp,v 1.6 2001-01-08 08:05:45 geuzaine Exp $
+// $Id: 3D_Extrude.cpp,v 1.7 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Const.h"
@@ -111,7 +111,7 @@ void Extrude_Simplex_Phase3 (void *data, void *dum){
   s = *pS;
 
   if(s->V[3] && !ep->mesh.Recombine){
-    Msg(ERROR, "Use '-recombine' to extrude with quadrangles");
+    Msg(GERROR, "Use '-recombine' to extrude with quadrangles");
   }
 
   k = 0;
diff --git a/Mesh/3D_Mesh.cpp b/Mesh/3D_Mesh.cpp
index 7a4e5b8496ac992a29b697b6c8f2be3502e6cf34..88c1eb0cd2bcb8855fd5acf1b8c2bee9ece364eb 100644
--- a/Mesh/3D_Mesh.cpp
+++ b/Mesh/3D_Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: 3D_Mesh.cpp,v 1.13 2001-01-08 08:05:45 geuzaine Exp $
+// $Id: 3D_Mesh.cpp,v 1.14 2001-01-09 19:40:56 remacle Exp $
 
 /*
  
@@ -551,7 +551,7 @@ bool Bowyer_Watson (Mesh * m, Vertex * v, Simplex * S, int force){
     for (i = 0; i < List_Nbr (Simplexes_Destroyed); i++){
       List_Read (Simplexes_Destroyed, i, &s);
       if (!Tree_Suppress (m->Simplexes, &s))
-        Msg(ERROR, "Impossible to Delete Simplex");
+        Msg(GERROR, "Impossible to Delete Simplex");
       Free (s);
     }
     
diff --git a/Mesh/Print_Mesh.cpp b/Mesh/Print_Mesh.cpp
index 5efda2dfff4364dcd3c001cd9e479ecbb3d0fb4b..e9c1c3b35d5fb181cee8f2c554f6357a81879221 100644
--- a/Mesh/Print_Mesh.cpp
+++ b/Mesh/Print_Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: Print_Mesh.cpp,v 1.10 2001-01-08 08:05:46 geuzaine Exp $
+// $Id: Print_Mesh.cpp,v 1.11 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Const.h"
@@ -271,7 +271,7 @@ void add_msh_elements (Mesh * M){
       break;
       
     default :
-      Msg(ERROR, "Unknown Type of Physical Group");
+      Msg(GERROR, "Unknown Type of Physical Group");
       break;
     }
 
diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp
index 6c3d7cfe853e283c24e5a5eb798bfaa0872657d7..2abec1c903ea408a7446cdc00bc4ac4b852f3509 100644
--- a/Mesh/Read_Mesh.cpp
+++ b/Mesh/Read_Mesh.cpp
@@ -1,4 +1,4 @@
-// $Id: Read_Mesh.cpp,v 1.5 2001-01-08 08:05:46 geuzaine Exp $
+// $Id: Read_Mesh.cpp,v 1.6 2001-01-09 19:40:56 remacle Exp $
 
 #include "Gmsh.h"
 #include "Geo.h"
@@ -131,7 +131,7 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){
         for(i=0 ; i<Nbr_Nodes ; i++) {
           vertsp[i] = &verts[i];
           if(!(vertspp = (Vertex**)Tree_PQuery(M->Vertices, &vertsp[i])))
-            Msg(ERROR, "Unknown Vertex %d in Element %d", verts[i].Num, Num);
+            Msg(GERROR, "Unknown Vertex %d in Element %d", verts[i].Num, Num);
           else
             vertsp[i] = *vertspp;
         }
@@ -191,7 +191,7 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){
 
     do {
       fgets(String, 256, File_GEO) ;
-      if (feof(File_GEO)) Msg(ERROR, "Prematured End of Mesh File");
+      if (feof(File_GEO)) Msg(GERROR, "Prematured End of Mesh File");
     } while (String[0] != '$') ;
     
   }   
diff --git a/Parser/FunctionManager.cpp b/Parser/FunctionManager.cpp
index 46e9114431ec5515edd451c68ff7aa1ad034222d..b9065b99eca6cdcf185b492fc6c6a4de6e156240 100644
--- a/Parser/FunctionManager.cpp
+++ b/Parser/FunctionManager.cpp
@@ -1,4 +1,4 @@
-// $Id: FunctionManager.cpp,v 1.6 2001-01-08 08:05:47 geuzaine Exp $
+// $Id: FunctionManager.cpp,v 1.7 2001-01-09 19:40:56 remacle Exp $
 
 #include <stdio.h>
 #include <stack>
@@ -28,14 +28,20 @@ class File_Position
 class mystack
 {
 public:
-  //std::stack<File_Position> s;
-  stack<File_Position> s;
+#ifdef WIN32
+	std::stack<File_Position> s;
+#else
+	stack<File_Position> s;
+#endif
 };
 class mymap
 {
 public :
-  //std::map<char*,File_Position,ltstr> m;
-  map<char*,File_Position,ltstr> m;
+#ifdef WIN32
+    std::map<char*,File_Position,ltstr> m;
+#else
+	map<char*,File_Position,ltstr> m;
+#endif
 };
 
 FunctionManager *FunctionManager::instance = 0;
@@ -55,9 +61,9 @@ FunctionManager* FunctionManager::Instance()
   return instance;
 }
 
-bool FunctionManager::enterFunction(char *name, FILE **f, int &lno) const
+int FunctionManager::enterFunction(char *name, FILE **f, int &lno) const
 {
-  if(functions->m.find(name) == functions->m.end())return false;
+  if(functions->m.find(name) == functions->m.end())return 0;
   File_Position fpold;
   fpold.lineno = lno;
   fpold.file = *f;
@@ -67,29 +73,29 @@ bool FunctionManager::enterFunction(char *name, FILE **f, int &lno) const
   fsetpos(fp.file,&fp.position);
   *f = fp.file;
   lno = fp.lineno;
-  return true;
+  return 1;
 }
 
-bool FunctionManager::leaveFunction(FILE **f,int &lno)
+int FunctionManager::leaveFunction(FILE **f,int &lno)
 {
-  if(!calls->s.size())return false;
+  if(!calls->s.size())return 0;
   File_Position fp;
   fp = calls->s.top();
   calls->s.pop();
   fsetpos(fp.file,&fp.position);
   *f = fp.file;
   lno = fp.lineno;
-  return true;
+  return 1;
 }
 
-bool FunctionManager::createFunction(char *name, FILE *f, int lno)
+int FunctionManager::createFunction(char *name, FILE *f, int lno)
 {
   File_Position fp;
   fp.file = f;
   fp.lineno = lno;
   fgetpos(fp.file,&fp.position);
   (functions->m)[name] = fp;
-  return true;
+  return 1;
 }
 
 
diff --git a/Parser/FunctionManager.h b/Parser/FunctionManager.h
index e3befed6a58f99f68b5fa15789e9b3d91484131e..0e82deb1bb8a54201d87f60a51bae01d1e83195c 100644
--- a/Parser/FunctionManager.h
+++ b/Parser/FunctionManager.h
@@ -17,9 +17,9 @@ class FunctionManager
     static FunctionManager *instance;
   public :
     static FunctionManager* Instance();
-    bool enterFunction (char *name, FILE **f, int &) const;
-    bool createFunction  (char *name, FILE *f, int);
-    bool leaveFunction (FILE **f, int &);
+    int enterFunction (char *name, FILE **f, int &) const;
+    int createFunction  (char *name, FILE *f, int);
+    int leaveFunction (FILE **f, int &);
 };
 
 #endif
diff --git a/Parser/Gmsh.tab.cpp b/Parser/Gmsh.tab.cpp
index c1e80bec226d1551224a855943e743008243607e..d6999925e3071f9ac49ad8e0abbc0b0f18d4f856 100644
--- a/Parser/Gmsh.tab.cpp
+++ b/Parser/Gmsh.tab.cpp
@@ -169,7 +169,7 @@
 #line 1 "Gmsh.y"
  
 
-// $Id: Gmsh.tab.cpp,v 1.57 2001-01-08 08:05:47 geuzaine Exp $
+// $Id: Gmsh.tab.cpp,v 1.58 2001-01-09 19:40:56 remacle Exp $
 
 #include <stdarg.h>
 
@@ -227,7 +227,7 @@ static StringXString  *pStrCat;
 static StringXNumber  *pNumCat;
 static StringXColor   *pColCat;
 
-void CreateFile (char *name, int format);
+void CreateFile (char *name, int format){}
 
 char *strsave(char *ptr);
 void  yyerror (char *s);
diff --git a/Parser/Gmsh.yy.cpp b/Parser/Gmsh.yy.cpp
index b3a1ff650322e690ab6f522b478c4d666b808da7..9c28d67d6c1f65c15a8324e7cbf7164d08282c5b 100644
--- a/Parser/Gmsh.yy.cpp
+++ b/Parser/Gmsh.yy.cpp
@@ -2,7 +2,7 @@
 /* A lexical scanner generated by flex */
 
 /* Scanner skeleton version:
- * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.57 2001-01-08 08:05:47 geuzaine Exp $
+ * $Header: /cvsroot/gmsh/Parser/Gmsh.yy.cpp,v 1.58 2001-01-09 19:40:57 remacle Exp $
  */
 
 #define FLEX_SCANNER
@@ -23,7 +23,7 @@
 #ifdef __cplusplus
 
 #include <stdlib.h>
-#include <unistd.h>
+//#include <unistd.h>
 
 /* Use prototypes in function declarations. */
 #define YY_USE_PROTOS
@@ -977,7 +977,7 @@ char *yytext;
 #define INITIAL 0
 #line 2 "Gmsh.l"
 
-// $Id: Gmsh.yy.cpp,v 1.57 2001-01-08 08:05:47 geuzaine Exp $
+// $Id: Gmsh.yy.cpp,v 1.58 2001-01-09 19:40:57 remacle Exp $
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/jpeg/jmorecfg.h b/jpeg/jmorecfg.h
index b056da59bf3c22da3f2b49d9a9f892b2b288d4a8..d609d90e28d928c3c08a5cc8584ff9121c9592b5 100644
--- a/jpeg/jmorecfg.h
+++ b/jpeg/jmorecfg.h
@@ -157,9 +157,11 @@ typedef short INT16;
 
 /* INT32 must hold at least signed 32-bit values. */
 
+#ifndef WIN32
 #ifndef XMD_H			/* X11/xmd.h correctly defines INT32 */
 typedef long INT32;
 #endif
+#endif
 
 /* Datatype used for image dimensions.  The JPEG standard only supports
  * images up to 64K*64K due to 16-bit fields in SOF markers.  Therefore
@@ -205,9 +207,11 @@ typedef unsigned int JDIMENSION;
  * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
  */
 
+#ifndef WIN32
 #ifndef HAVE_BOOLEAN
 typedef int boolean;
 #endif
+#endif
 #ifndef FALSE			/* in case these macros already exist */
 #define FALSE	0		/* values of boolean */
 #endif
diff --git a/jpeg/jpeglib.h b/jpeg/jpeglib.h
index 893f8b842beaf50b3a5cb88948afc90de9aa3511..ca33a83dba6494f4c27f214455c3dd508aaa7446 100644
--- a/jpeg/jpeglib.h
+++ b/jpeg/jpeglib.h
@@ -17,6 +17,10 @@
  * manual configuration options that most people need not worry about.
  */
 
+#ifdef WIN32
+#include <windows.h>
+#endif
+
 #ifndef JCONFIG_INCLUDED	/* in case jinclude.h already did */
 #include "jconfig.h"		/* widely used configuration options */
 #endif