[Qt-interest] Names clashing?..
Rohan McGovern
rohan.mcgovern at nokia.com
Mon Aug 23 06:26:01 CEST 2010
Anatoly Burakov said:
> Hi all
>
> My program uses a library (custom-made). It's got a section with
> communication constants organized into enum's. I am exploring the Qxt
> library and it's got some mingw libraries #include'd. They in turn have
> some #define'd constants and their names are clashing with the names in
> my library (names like DELETE are pretty common...). As i understand,
> when the constant is #define'd namespaces don't affect them.
>
> Is there an easy solution to my problem (besides not using Qxt and
> changing names in my library)?
Qt itself has a similar problem. It deals with it by pushing the
problem back to the user of these headers, giving a sensible error
if the user doesn't include them in the right order.
For example, in src/corelib/io/qdatastream.h, there is this:
> #ifdef Status
> #error qdatastream.h must be included before any header file that defines Status
> #endif
--
Rohan McGovern
QA Engineer
Qt Development Frameworks, Nokia
More information about the Qt-interest-old
mailing list