Recently need to use the triangular grid generated some things, so the triangle this library compiled a bit, found that the compilation process is a little tangled, so think of writing down, hope that some children's shoes to see less go some detours.
First of all thank Eryar for your help, thank you very much!
Before compiling, let's look at Eryar's blog post:
http://www.cnblogs.com/opencascade/p/3632705.html
I compiled it under the Windows environment of Visual Studio.
The beginning of the stumbling also compiled, but in C + + is not available, so help Eryar to finally succeed:
Directly on the code bar, the triangle header file changes as follows:
#ifndef _triangle_header_#define _triangle_header_
#ifdef _cplusplusextern "C" {#endif//change here, the blog bold changed color after the code, I do not know why the # define REAL double#define ansi_declarators#define VOID Int#include "triangle.h" 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; /* Used with Voronoi diagram; Out only */REAL *normlist; /* Used only with Voronoi diagram; Out only */int numberofedges; /* out only */}; #ifdef Ansi_declarAtorsvoid triangulate (char *, struct Triangulateio *, struct Triangulateio *,struct Triangulateio *); void Trifree (void *me MPTR); #else/* Not ansi_declarators */void triangulate (); void Trifree (); #endif */Not ansi_declarators */#ifdef _CPLUSPLU s} #endif///change here, the blog bold changed color after the code, I do not know why
#endif
At the same time in the triangle.c inside modify:
Will:
/* #define NO_TIMER */
/* #define Trilibrary*/
Switch
#define No_timer
#define Trilibrary
It is OK to open the two macro definitions.
Successfully generated Lib Library