[Qt-interest] Names clashing?..

Bo Thorsen bo at thorsen-consulting.dk
Mon Aug 23 06:14:34 CEST 2010


Den 20-08-2010 08:12, Anatoly Burakov skrev:
> 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)?

You have several options:

- separate the code so you don't include the library and qxt headers 
from the same places

- undefine the clashing defines

- remove those defines from your library

- patch the library or qxt

Bo Thorsen,
Thorsen Consulting.



More information about the Qt-interest-old mailing list