What preprocessor can I used to detect if QT is used to build my codes

2k views Asked by At

I am writing a library project in C, which may be built with or without QT. Is there any preprocessor directive (no extra headers are required) that can I use to distinguish whether QT is in use in the C code?

I would like to do somthing like:

#ifdef I_AM_QT
// some qt specific codes
#else
// some codes for other environments
#endif

Thanks.

1

There are 1 answers

2
synacker On
#ifdef QT_CORE_LIB
// some qt specific codes
#else
// some codes for other environments
#endif