Background
I am trying to make a small service program in plain C that is going to read bluetooth and TCP/IP. In order to do so, I need to use the Windows SDK, but I get compilation errors with due to invalid "__w64" constants. Considering I cannot find which value the compiler passes to the "__w64" constant, I decided to use Visual studio 2019 compiler into code blocks since I cannot successfully make a "Hello World" inside Visual Studio. (that's another story). It could fix my "__w64" issues else Using MinGW64 instead of 32 would be my next solution.
Problem
I found a PDF online that list a series of step consisting in defining Global variables with all the necessary path, and then changing the compiler settings with those variables. I used MSVC 2010 configuration, I set the global variable in the "Toolchain executable" tab, and all the programs have the right file name: "cl.exe", "link.exe", etc. In my project build option, I selected the "Microsoft Visual C++ 2010" compiler where my config should be.
Now when I try to compile the program, it stills try to compile the project with gcc.exe even if the executables are set to cl.exe. Here is an example of output, as a proof, it adds the "/wp64" option which is MSVC specific but with the gcc execuatable.
gcc.exe /Wp64 -Wall -std=c99 -g -Isrc -c "C:\Program Files\Git\CVP\service\src\test.c" -o obj\Debug\src\test.o
gcc.exe -o bin\Debug\cvps.exe obj\Debug\src\main.o obj\Debug\src\test.o -lws2_32
gcc.exe: error: /Wp64: No such file or directory
How can I tell the C::B to use cl.exe, instead of gcc.exe?
Instead of trying a bluetooth example, I compiled a TCP/IP example using gcc. It worked, but I had to add the following define before the includes for the compilation to work:
#define _WIN32_WINNT 0x0501
So TCP/IP is supported by MinGW, but not bluetooth. Then I completed the tutorial made by cacb and it now called cl.exe correctly. But even if I set the includes path correctly, it cannot find "winsock2.h" and "corecrt.h". The second file does not seem to exist on my hard drive.
The next solution would be to try upgrading the Win SDK to 10 if I really need MSVC.