I recently installed mingw-w64 to learn c without needing cygwin. The issue is that mingw32-make is using g++ to compile my .c source, but I don't really know why. The behavior is illustrated here:
here's the source:
#include <stdio.h>
int main(int argc, char *argv[])
{
puts("Hello world.");
return 0;
}
here's the makefile:
CC = gcc -O
CFLAGS=-Wall -g
clean:
rm -f hello_world
using gnuwin32 version of make:
-> make hello_world
gcc -O -Wall -g hello_world.c -o hello_world
using mingw32-make:
-> mingw32-make hello_world
g++ hello_world.c -o hello_world
Can someone explain this, or know why its happening? Using Cygwin, and also using Linux, the make tool uses a c-compiler (usually cc) as expected. Why does mingw32-make use g++, instead of gcc. gcc is installed in the bin directory.
mingw-w64 is the latest winbuild as of 2 days ago
-x cto force C compilation. Add it to yourCFLAGS. You could also addCXX = gcc -Oto your makefile. If its not honored too, then it might help isolate the problem further.