Check for librt linking

1.8k Views Asked by At

Is there a macro that I can #ifdef for to check if librt has been linked to, ie by -lrt with gcc?

1

There are 1 best solutions below

1
On BEST ANSWER

No, gcc doesn't have such macro (I've dumped preprocessor macros to check). On Windows with Microsoft compiler you can use _VC_NODEFAULTLIB macro to detect builds without libc reference.