I need clang for my experimentations in Windows. I tried to compile and link with clang on Windows. However, I’m getting a bunch of linking errors. For example:
error LNK2005: _InterlockedIncrement64 already defined in cc-000000.o
error LNK2005: _InterlockedDecrement64 already defined in cc-000000.o
error LNK2005: _InterlockedExchange64 already defined in cc-000000.o
error LNK2005: _InterlockedExchangeAdd64 already defined in cc-000000.o
I was able to see the reason. When a source file includes “Windows.h” and does use Win32 APIs, then clang emits some Win32 API definitions in the object files. I’ve confirmed by looking bitcode.