Compilation errors when creating a DLL

I’m getting errors building a Windows dynamic library (DLL) that links against cocos2d-x (v3.14.1), with random errors popping up in CCApplicationProtocol.h (prebuilt or compiled cocos2d-x, doesn’t make a difference). Using VS2017 Community edition.

The actual issue may be because OS_WINDOWS is already defined in a Windows header file, shlwapi.h. Is there anything that can be done about this so I can get it to compile successfully?