[visual-c++] fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'

Many good suggestions above.

Also if you are trying to build in x86 Win32:

Make sure that any libraries you link to in Program Files(x86) are actually x86 libraries because they are not necessarily...

For example a lib file I linked to in C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\SDK threw that error, eventually I found an x86 version of it in C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x86 and everything worked fine.