Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation error when windows.h is included #30

Closed
matbech opened this issue Jul 31, 2018 · 0 comments
Closed

compilation error when windows.h is included #30

matbech opened this issue Jul 31, 2018 · 0 comments
Assignees
Labels

Comments

@matbech
Copy link
Contributor

matbech commented Jul 31, 2018

when windows.h is included before taocpp, the following error occurs:
\include\tao\json\binding\member_kind.hpp(15): error C2059: syntax error: ','
The problem is caused by the OPTIONAL define:

         enum class member_kind : bool
         {
            OPTIONAL,
            REQUIRED
         };

which is defined in:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\shared\minwindef.h

#ifndef OPTIONAL
#define OPTIONAL
#endif

Similar issues with TRUE and FALSE:
include\tao\json\msgpack\internal\format.hpp

               FALSE = 0xc2,
               TRUE = 0xc3,

The workaround is to undefine them before including tao:

#undef OPTIONAL
#undef TRUE
#undef FALSE

but this is not very practical (TRUE/FALSE are used everywhere in a typical Windows app).

@d-frey d-frey self-assigned this Jul 31, 2018
@d-frey d-frey added the bug label Jul 31, 2018
d-frey added a commit that referenced this issue Aug 1, 2018
@d-frey d-frey closed this as completed Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants