diff --git a/meldata.cc b/meldata.cc
index cd441543aa8657fd51abf1e71972a907e4f227fc..35549c09a8f5390725718db5a8928b5275ce0c20 100644
--- a/meldata.cc
+++ b/meldata.cc
@@ -14,6 +14,7 @@
 #include "meldata.h"
 #include "melodic.h"
 #include "utils/log.h"
+#include <time.h>
 
 using namespace Utilities;
 using namespace NEWIMAGE;
diff --git a/melgmix.cc b/melgmix.cc
index bfcf5443d033ce4de0ff14c2bb687da99e027112..b586365aeb2b474d55678f77783679e2c8343423 100644
--- a/melgmix.cc
+++ b/melgmix.cc
@@ -15,6 +15,7 @@
 //#include "melmm.h"
 #include "utils/log.h"
 #include "miscmaths/miscprob.h"
+#include <time.h>
 #include "libvis/miscplot.h"
 #include "libvis/miscpic.h"
 
diff --git a/melica.cc b/melica.cc
index 74ae29a7feb51b57b2958ca3b7b0189aaa6ae856..c162722579eb5d0cb465af0f3eea80afbc9efaad 100644
--- a/melica.cc
+++ b/melica.cc
@@ -9,6 +9,7 @@
 
 /*  CCOPYRIGHT  */
 
+#include <stdlib.h>
 #include "newimage/newimageall.h"
 #include "utils/log.h"
 #include "meloptions.h"
diff --git a/melodic.cc b/melodic.cc
index 3bc3370de1b5d83d529962261647ddcb8af48171..cac0af8256a2bf3174cacf3bd77e1c0a812c8e29 100644
--- a/melodic.cc
+++ b/melodic.cc
@@ -9,11 +9,14 @@
 
 /*  CCOPYRIGHT  */
 
+#include <iostream>
 #include "newmat/newmatap.h"
 #include "newmat/newmatio.h"
 #include "newimage/newimageall.h"
 #include "miscmaths/miscmaths.h"
 #include "miscmaths/miscprob.h"
+#include <string>
+#include <math.h>
 #include "utils/options.h"
 #include "utils/log.h"
 #include "meloptions.h"
diff --git a/melodic.h b/melodic.h
index 24e69d9fb710aad2c3c23c259a3fef523156adf6..c18372642341ae7e5d0142c629b2c1d5672ceb9d 100644
--- a/melodic.h
+++ b/melodic.h
@@ -12,6 +12,7 @@
 #ifndef __MELODIC_h
 #define __MELODIC_h
 
+#include<strstream>
 
 // a simple message macro that takes care of cout and log
 #define message(msg) { \
diff --git a/meloptions.cc b/meloptions.cc
index 2e93e6867efa1fda93cff123ebef995992f2dfb4..a79c6001abb29ebbd1ae97118e31f7155a512c13 100644
--- a/meloptions.cc
+++ b/meloptions.cc
@@ -10,6 +10,10 @@
 
 /*  CCOPYRIGHT  */
 
+#include <iostream>
+#include <fstream>
+#include <stdlib.h>
+#include <stdio.h>
 #include "utils/log.h"
 #include "meloptions.h"
 #include "newimage/newimageall.h"
diff --git a/meloptions.h b/meloptions.h
index f56c7de193bd526e622e7337565e00f8c8d65353..17d85e1f3b2443fd936996507569596e57ecde31 100644
--- a/meloptions.h
+++ b/meloptions.h
@@ -14,6 +14,12 @@
 #ifndef __MELODICOPTIONS_h
 #define __MELODICOPTIONS_h
 
+#include <string>
+#include <strstream>
+#include <iostream>
+#include <fstream>
+#include <stdlib.h>
+#include <stdio.h>
 #include "utils/options.h"
 #include "utils/log.h"
 #include "melodic.h"
diff --git a/melreport.h b/melreport.h
index 9073f88d0c8464118a61e6ecb51c9624e17f538e..7563fd1c2d07795a3737f608d226e4e1dd1a2042 100644
--- a/melreport.h
+++ b/melreport.h
@@ -21,6 +21,8 @@
 #include "melodic.h"
 #include "newmat/newmatap.h"
 #include "newmat/newmatio.h"
+#include <time.h>
+#include <strstream>
 #include "libvis/miscplot.h"
 #include "libvis/miscpic.h"
 #include "utils/options.h"
diff --git a/test.cc b/test.cc
index a98e57a7fa1a79450dcb343b4cdb7b7d8985e1e4..2e66ce624bc64a017190bf1da48b8a646397e873 100644
--- a/test.cc
+++ b/test.cc
@@ -1,3 +1,5 @@
+#include <iostream.h>
+#include <iomanip>
 #include "libvis/miscplot.h"
 #include "libvis/miscpic.h"