I wrote a dll in C for Windows. When I call the dll, I get the following error:

Win Error 1114 A dynamic link library (DLL) initialization routine failed
Nearly all of the research I have done in this area focus on graphics cards, but this dll doesn't call for any special graphics. In fact, it's dead simple.

Here is the code for the dll. I compiled it with Clang and linked it with lld-link:

#define EXPORT __declspec(dllexport)
  EXPORT int SSV ();

  __declspec(dllexport) int __stdcall SSV()
      int n = 0;

      while(n != 1000000000){
          n += 1;

  return n;
The compile string:

clang -c -O3 SxSv.c
The link string:

lld-link /DLL /ENTRY:SSV SxSv SxSv.obj
Thanks for any ideas on why I get the "initialization routine failed" error for this dll.