JonnyCplusplus
JonnyCplusplus

Reputation: 881

CMake conflicting header files

I am using boost (which uses time.h) and a C library(libav) that has a header file that is also called time.h. So when boost tries to use time.h it's calling the time.h from libav as apposed the ANSI C standard time.h.

How do I force libav to find it's own time.h and boost to use the ANSI C standard time.h? And I don't want to modify the libraries at all as this code needs to build everywhere.

Thanks!

Upvotes: 0

Views: 674

Answers (1)

Slava
Slava

Reputation: 44238

time.h from libav should not conflict with time.h from /usr/include as it included in libav sources as:

#include "libavutil/time.h"

At least it included this way in latest version of libav from git repository. If you have older version, that does not do that, you should probably upgrade. If you set libavutil directory in include path by mistake, you should remove that (or change to path that does not include dir libavutil itself).

Upvotes: 3

Related Questions