I have a dilemma. In a program I'm writing using Qt, I use a (non-Qt) library that uses a Qt keyword in its headers as a name (the library being pf_ring to be precise, and the name "slots") and so I get compilation errors. But if I turn off Qt keywords using the no_keywords option, the compiler complains about another library's headers (this one Qt-based) which use Qt keywords like "signals" and "slots."
So how can I fix this? I can think of only two options neither of which is very satisfactory:
I can change the second library's header files so that they comply with the no_keywords mode (changing "slots" to "Q_SLOTS" and so forth).
I can move the pf_ring related code into its own sub-project in which I can turn off Qt keywords or simply not use Qt at all.
Can you suggest another, hopefully more elegant and less troublesome, solution?
This depends on the library, if it's a small one you can make a "wrapper" header (only or not) that doesn't expose slots or expose it in a wrapper_namespace (note that you can use #undef slots
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With