Moeltiepas
Moeltiepas

Reputation: 101

Tetgen tetcall compiling error

I want to use Tetgen to calculate the volume of a given set of points by tetrahedralization. I already saw a snippet in the code doing this, and might only requires some tweaking.

The problem I have is to get tetcall (a testing program for tetgen) to get running. If I want to compile it (in the Linux terminal using g++ -o test tetcall.cxx -L./ -ltet ). I get:

test.cpp:183:24: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] test.cpp:184:23: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] test.cpp:190:30: error: cannot convert ‘tetgenio::polygon*’ to ‘tetgenbehavior*’ for argument ‘1’ to ‘void tetrahedralize(tetgenbehavior*, tetgenio*, tetgenio*, tetgenio*, tetgenio*)’ test.cpp:193:26: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] test.cpp:194:29: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] test.cpp:195:26: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

Including -L./ -ltet in the command or not doesn't seem to matter to the error.

Those warnings I think aren't such a problem. What I don't understand the error for line 190 tetcall.cxx calling the function tetrahedralize:

tetrahedralize("pq1.414a0.1", &in, &out);

doesn't work, I didn't change anything, and got it all from the site [http://tetgen.berlios.de/][1] I compiled the library, with some warnings, with $ make tetlib All files (including libtet.a) are in the same map. The function I think the compiler wants connect, and where it might go south, is in tetgen.cxx line 34498

void tetrahedralize(tetgenbehavior *b, tetgenio *in, tetgenio *out,
  tetgenio *addin, tetgenio *bgmin)

I took a look at the tetgenbehavior class in the header, but I couldn't really figure out what to make of the variable tetgenbehavior *b or how to figure out its type. I saw some char members I think are meant as switches. What am I doing wrong, and what is the cause of the error?

Upvotes: 1

Views: 692

Answers (2)

ljofre
ljofre

Reputation: 324

try to use this command

g++ -o test tetcall.cxx -DTETLIBRARY -L./ -ltet

Upvotes: 1

Mary Ellen Bench
Mary Ellen Bench

Reputation: 589

This is probably an old question, and you likely figured it out, but you need to set the preprocessor definition of TETLIBRARY.

Upvotes: 2

Related Questions