[vtkusers] namespace problems..

K.R.Subramanian krs at zappa.uncc.edu
Sat Feb 17 14:21:01 EST 2001


I am using the standard template library (list, vector, iostream) in
vtk applications, but
the "using" directive doesnt seem to do the right thing.


for instance:

*****************************
#include <list>
#include <vector>
#include <iostream>
#include <vtkStructuredPoints.h>

using namespace std;

main ()
{
    list<int> a;

    vector<float> b;

    b.push_back (4.0);
    b.push_back (8.0);
    b.push_back (12.0);

    cout << b[0] << "," << b[1] << "," << b[2] << endl;
}

gives the following errors:

       CC -g  -n32 -woff 1681,1682 -LANG:std  -I. -I/usr/include/CC
-I/afs/uncc/cs/irix/irixlinks/include/common
-I/afs/uncc/cs/irix/irixlinks/include/graphics
-I/afs/uncc/cs/irix/irixlinks/include/imaging
-I/afs/uncc/cs/irix/irixlinks/include/patented   -c tmp1.cc -o tmp1.o
cc-1239 CC: ERROR File = tmp1.cc, Line = 18
  "cout" is ambiguous.

        cout << b[0] << "," << b[1] << "," << b[2] << endl;
        ^
***********************************
1 error detected in the compilation of "tmp1.cc".


Without the vtk include file, there is no problem.

Is this a known problem?  Else, could someone point out what I am doing
wrong This is on
an SGI IRIX 6.5   compiler..

Thanks.

    -- krs



--
K.R.Subramanian                           Phone: (704) 687-4872
Department of Computer Science            FAX:   (704) 687-3516
UNC Charlotte, 311 CARC
9201 Univ. City Blvd.                     Email: krs at cs.uncc.edu
Charlotte, NC 28223-0001                  WWW: http://www.cs.uncc.edu/~krs







More information about the vtkusers mailing list