Hello, I’ve been recently working on trying to get my game building using LLVM Clang, and it seems to work up to a point. I followed the directions outlined here, and set everything up to build using clang-cl rather than cl. The problem comes when its time to link. It seems that some of my modules have a dependency on MinimalWindowsApi.h (not sure where exactly, but that’s what the compiler is complaining about. I’ve seemed to trace it back to this set of lines in the header file.
#ifdef __clang__
#define MINIMAL_WINDOWS_API CORE_API
#else
#define MINIMAL_WINDOWS_API extern "C" __declspec(dllimport)
#endif
It seems like when linking using Clang-CL/MSVC, that ifdef causes the incorrect linkage to be defined. When changing the line to this, it works.
#if defined(__clang__) && !defined(_MSC_VER)
#define MINIMAL_WINDOWS_API CORE_API
#else
#define MINIMAL_WINDOWS_API extern "C" __declspec(dllimport)
#endif
I’m pretty sure this is a bug of some kind, and it’s a fairly easy change to make to the engine source, but given that my project is intended to be used by other people as a library, asking them to change their engine source is a bit of a problem. Is this an actual bug, or am I missing something that would enable me to build without source modifications?