I have the code below. I have tried compiling with gcc and g++ to no avail. For gcc it gives a fatal iostream error. For g++ it throws a huge list of errors. I'm fairly new to programming, and have no idea how to get this to compile. I'm very lost.
Here is the code:
using namespace std;
#include <iostream>
#include <fstream>
#include <ctype.h>
#include <math.h>
#if defined(__sparc)
#include <ieeefp.h> // include file for "finite" function on sparc
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "surfstruct.h"
#include "surf3dread.h"
/* #include "caretio.h" */
#include "flags.h"
#include "read.h"
#include "error.h"
/* Global Variables */
extern int nvertex, ntriangle, offset;
extern int tri_notsurf, triangle_ttl, vertex_ttl, u_edge_insurf_ttl;
extern int **colour_int, **tricolour_int;
extern float **colour_flt;
extern int GEOG, surftype;
extern struct vertexinfo *vertex;
extern struct triinfo *triangle;
extern struct edgeinfo *edge;
extern int TriNumCmp(const void *, const void *);
/* check the input file exists */
printf("Reading 3d co-ordinates in file %s ...\n",name);
// fprintf(outfile,"Reading 3d co-ordinates in file %s ...\n",name);
outfile << "Reading 3d co-ordinates in file " << name << " ..." << endl;
/* read input file to get vertices and metric info */
GetLine(infile, header);
sscanf(header, "%d %d %d %d", &tmp, &nvertex, &ntriangle, &nedge);
Always start with the first error in the list. Often one error will make the compiler report other errors later in the code which makes it look like there are more errors than actually is the case.