[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] Problems compiling ns-2 2000-12-07 snapshot on win2k



>My original implementation used 
>
>#include <pair.h>
>
>instead of the 
>
>#include <utility>
>
>that's there now....
>The problem seems to be needing a definition of the STL "pair" template,
>which is in "pair.h", but gets included from the "utility"
>include in the released version...try changing it to "pair" or "pair.h"
>on MSVC and see if it fixes the prob (I don't have a windows box handy or
>would try it myself..)

According to my STL manual <utility> is preferred:
<http://www.sgi.com/Technology/STL/pair.html>, look at "Definition"
section.  Too bad MSVC is behind.

Does this patch fix it?

   -John Heidemann


Index: nixvec.h
===================================================================
RCS file: /nfs/jade/vint/CVSROOT/ns-2/nix/nixvec.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -u -r1.1 -r1.2
--- nixvec.h    2000/12/01 23:38:36     1.1
+++ nixvec.h    2000/12/07 17:03:31     1.2
@@ -25,6 +25,9 @@
 #define __NIXVEC_H__
 
 #include <utility>  // for pair
+#ifdef WIN32
+#include <pair.h>   // for MSVC 6.0 that doens't have a proper <utility>
+#endif /* WIN32 */
 
 // Define a type for the neighbor index
 typedef unsigned long Nix_t;