10 years ago.  This question has been closed. Reason: Duplicate question

Conditional Library compilation

I have two libraries : SPI_TFT and SPI_TFT_ILI9341. I need to use one *or* the other depending on the type of display controller a user has. I tried adding #ifdef #else around the #include statements so I only reference one in the code, but the compiler still compiles both libraries and gives me multiple definition errors (L6200E). How can I tell the compiler not to compile a library included in a project?