I just downloaded llvm-11-win64 from official llvm website (I need to use clang instead of mingw-g++). I'm trying to compile a test C++ file that includes <windows.h> (the header files are taken from a mingw64 install)
// test.cpp
#include <windows.h>
bool WINAPI DllMain(HINSTANCE hModule, DWORD fwdReason, LPVOID reserved)
{
return TRUE;
}
Typical command line compilation gives an error, should I do something different?
$ clang++ -I "/c/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include/" -c test.cpp
In file included from test.cpp:2:
In file included from C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include\windows.h:69:
In file included from C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include\windef.h:8:
In file included from C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include\minwindef.h:163:
In file included from C:/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/x86_64-w64-mingw32/include\winnt.h:1554:
In file included from C:\Program Files\LLVM\lib\clang\11.0.0\include\x86intrin.h:15:
In file included from C:\Program Files\LLVM\lib\clang\11.0.0\include\immintrin.h:15:
C:\Program Files\LLVM\lib\clang\11.0.0\include\mmintrin.h:67:40: error: cannot initialize a parameter of type '__attribute__((__vector_size__(2 * sizeof(int)))) int'
(vector of 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
^~~~~~~~~~~