diff --git a/Fltk/GmshServer.cpp b/Fltk/GmshServer.cpp
index 76b890ec20c7ccb24bb77c1920814e65add75161..88e00a4ae72d76df7d7c93e441bad1126aeb2340 100644
--- a/Fltk/GmshServer.cpp
+++ b/Fltk/GmshServer.cpp
@@ -1,4 +1,4 @@
-/* $Id: GmshServer.cpp,v 1.10 2003-03-01 22:36:38 geuzaine Exp $ */
+/* $Id: GmshServer.cpp,v 1.11 2003-03-05 23:15:04 geuzaine Exp $ */
 /*
   Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
 
@@ -27,7 +27,7 @@ void SystemCall(char *str);
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef _AIX
+#if defied(_AIX)
 #include <strings.h>
 #endif
 #include <sys/types.h>
@@ -59,7 +59,7 @@ static int Socket_ReceiveData(int socket, void *buffer, int bytes)
 
 static int Socket_UnlinkName(char *name)
 {
-#ifdef _AIX
+#if defined(_AIX)
   char name2[1000];
   strcpy(name2, name);
   name2[strlen(name2) - 1] = '\0';
@@ -75,7 +75,7 @@ static int Socket_UnlinkName(char *name)
 int Gmsh_StartClient(char *command, char *sockname)
 {
   int s, sock;
-#if defined(linux) || defined(_AIX)
+#if defined(linux) || defined(_AIX) || defined(__FreeBSD__)
   socklen_t len;
 #else
   int len;
diff --git a/Plugin/Plugin.cpp b/Plugin/Plugin.cpp
index f86c17384c391a943ee32b1a61597dcef6e4b4ce..17d5ef5f3842ddac76d50c1a57486245853c61d2 100644
--- a/Plugin/Plugin.cpp
+++ b/Plugin/Plugin.cpp
@@ -1,4 +1,4 @@
-// $Id: Plugin.cpp,v 1.38 2003-03-02 01:18:33 geuzaine Exp $
+// $Id: Plugin.cpp,v 1.39 2003-03-05 23:15:04 geuzaine Exp $
 //
 // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle
 //
@@ -197,14 +197,14 @@ void GMSH_PluginManager::AddPlugin(char *dirName, char *pluginName)
   sprintf(dynamic_lib, "%s/%s", dirName, pluginName);
   Msg(INFO, "Opening Plugin '%s'", dynamic_lib);
   void *hlib = dlopen(dynamic_lib, RTLD_NOW);
-  char *err = dlerror();
+  char *err = (char*)dlerror();
   if(hlib == NULL) {
     Msg(WARNING, "Error in opening %s (dlerror = %s)", dynamic_lib, err);
     return;
   }
   RegisterPlugin =
     (class GMSH_Plugin * (*)(void))dlsym(hlib, GMSH_PluginEntry);
-  err = dlerror();
+  err = (char*)dlerror();
   if(err != NULL) {
     Msg(WARNING, "Symbol '%s' missing in plugin '%s' (dlerror = %s)",
         GMSH_PluginEntry, pluginName, err);