0

I have a problem of terminology here, that would be super nice if you can help, I am not sure what this means.

On the tetgen website, the instructions to compile the tetgen library on Windows are as follows:

To create a library do the following minimum steps:

  • Create a Win32 static library called library.
  • Add all source files into this project.
  • Add the symbol TETLIBRARY to compile switches.
  • Build the project.

I don't understand this statement:

Add the symbol TETLIBRARY to compile switches.

Could you please tell me how to do that, and what "compile switches" refers to?

adrienlucca.net
  • 677
  • 2
  • 10
  • 26

1 Answers1

2

In this case, "compile switches" is referring to preprocessor definitions that direct what gets compiled. To add the TETLIBRARY definition in Codeblocks, there are a couple ways:

1) You can insert it directly into the code, using this line:

#define TETLIBRARY

In general this needs to be placed appropriately, such that it is defined prior to all references across files. (In this case, sticking it at the top of the .h file would work.)

2) The preferred way, when the preprocessor definition is used to direct compilation, is to include it in your project configuration. In Codeblocks, you would follow these steps: a) Right-click on the project you created in the Projects tab. b) Click on "Build Options...". c) With the debug or release target selected, click on the "#defines" tab. d) In the blank space, enter

TETLIBRARY

e) Repeat steps c and d for the other build target, if desired.

David Duncan
  • 1,225
  • 8
  • 14
  • clicking on a target will only change options for that target. To make the change for all targets you can click on the project name in that left-hand pane. Then the individual targets either add to or overwrite the all-targets settings, depending on the Policy choice for each target. – M.M Aug 30 '16 at 21:57