Hardly a new error message :) I would really appreciate some help in cracking this nut thought...
I have 2 projects; the first contains a header file and a .c file. I have not written this code. The c file is +16000 lines. The header file is simple:
#define ANSI_DECLARATORS
#define SINGLE
#ifdef SINGLE
#define REAL float
#else /* not SINGLE */
#define REAL double
#endif /* not SINGLE */
struct triangulateio {
REAL *pointlist; /* In / out */
REAL *pointattributelist; /* In / out */
int *pointmarkerlist; /* In / out */
int numberofpoints; /* In / out */
int numberofpointattributes; /* In / out */
int *trianglelist; /* In / out */
REAL *triangleattributelist; /* In / out */
REAL *trianglearealist; /* In only */
int *neighborlist; /* Out only */
int numberoftriangles; /* In / out */
int numberofcorners; /* In / out */
int numberoftriangleattributes; /* In / out */
int *segmentlist; /* In / out */
int *segmentmarkerlist; /* In / out */
int numberofsegments; /* In / out */
REAL *holelist; /* In / pointer to array copied out */
int numberofholes; /* In / copied out */
REAL *regionlist; /* In / pointer to array copied out */
int numberofregions; /* In / copied out */
int *edgelist; /* Out only */
int *edgemarkerlist; /* Not used with Voronoi diagram; out only */
REAL *normlist; /* Used only with Voronoi diagram; out only */
int numberofedges; /* Out only */
};
#ifdef ANSI_DECLARATORS
externvoid triangulate(char *, struct triangulateio *, struct triangulateio *, struct triangulateio *);
externvoid trifree(void *memptr);
#else /* not ANSI_DECLARATORS */
void triangulate();
void trifree();
#endif /* not ANSI_DECLARATORS */
I have compiled this as a static lib (.lib).
The second project contains a cpp class with a header file and a .cpp file. I have linked to the first project by
1) adding #include to the header file from the first project (see above)
2) linking to the .lib file
When I compile (I have tried with both Visual studio and gcc) I get 'unresolved external symbol' when using the triangulate method.
It's in the +16000 lines triangle.c file.
I've just tried changing the extension of the file (triangle.c -> triangle.cpp) and now it compiles fine in both vc++ and gcc. I have no idea why, but it took me all morning to figure it out.
Thx for you interest.