I am creating a library (.lib) in c++ with Visual Studio 2008. I would like to set a variable to change the behaviour of the library depending on the variable. Simplifying a lot, something like this:

```
#ifdef OPTION1
i = 1;
#else
i = 0;
#endif

```

But the variable (in this case OPTION1) should not be defined in the library itself, but in the code that links to the library, so that just changing the definition of the variable I could obtain different behaviours from the program, but always linking to the same library.

Is this possible, and how? Or is there a more elegant way to achieve what I want?