Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 744
wing999 Avatar asked Jun 15 '15 08:06

wing999


1 Answers

#ifdef QT_CORE_LIB
// some qt specific codes
#else
// some codes for other environments
#endif
like image 119
synacker Avatar answered Oct 21 '22 01:10

synacker