Question

Firstly, I have looked all over for solutions and I can't seem to fix it. When trying to compile source code I get the following error.

g++ -c -I/home/jcallahan/ACM/include/FANSI -I/home/jcallahan/ACM/FourtyTwo/Base -I/home/jcallahan/ACM/FourtyTwo/FunctionSpaces -I/home/jcallahan/ACM/FourtyTwo/MeshLib LagrangeFunctions.cpp In file included from /home/jcallahan/ACM/include/FANSI/MatrixVector.h:6:0, from LagrangeFunctions.cpp:17: /home/jcallahan/ACM/include/FANSI/Matrix.h:184:24: error: ‘ostream’ has not been declared void WriteToTextFile(ostream &) ;

The error is coming from the included Matrix.h and Vector.h (I have more of these errors only showing one). I believe the error is within Matrix.h/Vector.h. The code is cut off because I do not think that the classes member functions have anything to do with it.

#include "AbstractMatrix.h"

class Matrix : public AbstractMatrix
{
  friend std::ostream &operator<<(std::ostream &,const Matrix &) ;
  friend std::istream &operator>>(std::istream &, Matrix &) ;
 public:

Anyone have any clue what is going on or how I can fix it? For additional info I am using the g++ compiler.

Was it helpful?

Solution

The file you posted should include this line:

#include <iostream>

Also, the error message includes this definition:

void WriteToTextFile(ostream &) ;

That needs to be changed to std::ostream like the others.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top