How do I avoid name collision with macros defined in Windows header files?

后端 未结 8 1393
一向
一向 2020-12-10 11:24

I have some C++ code that includes a method called CreateDirectory(). Previously the code only used STL and Boost, but I recently had to include

8条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-10 11:42

    You will be better off if you just rename your CreateDirectory method. If you need to use windows APIs, fighting with Windows.h is a losing battle.

    Incidently, if you were consistent in including windows.h, this will still be compiling. (although you might have problems in other places).

提交回复
热议问题