In wxDev-C++ 7.3.1.3 (and possibly other versions as well; I haven't checked), adding C source code to a project results in the generated makefile compiling the code with the C++ compiler and not the C compiler; upon closer inspection of the .dev file for my project, I noticed that the C source code that I wrote (my entire project is in C) appeared to be indicated to be C++ source code by all of their respective "CompileCpp" attributes set to one. I quickly tried changing all of these values to zero, and noticed that the generated makefile then regarded these files as C code and switched to using the C compiler instead. A problem remained, however, that the linker remained to be g++ and not gcc; I don't know if this affects the final, linked binary, but I would assume that gcc should be used instead.
Furthermore, if I were to change "IsCpp" in the .dev file to zero (as opposed to its initial value of one), it is automatically reverted to one, and no change is made in the makefile.
On a side note, the "Compile" and "Link" attributes of all of the header files in my project were set to one and not zero; I changed these to zero thinking their compilation unnecessary, but am unsure if it made any difference (I have not compared the generated makefiles).
I am running wxWidgets 7.3.1.3 (as I noted earlier) on a licensed copy of Windows 7 with the latest patches applied, though I doubt the operating system makes a difference in this case.
Anonymous
Nick,
Can you attached a sample project for me to test?
I think the problem you are seeing is that the wxWidgets libraries are built in C++. So if you add a C source code to a C++ project, the IDE has to use the C++ compiler (which can handle both C and C++ code).
At the end of the day, whether gcc or g++ is used is not really important. gcc is a front-end which compiles many types of source code (not just c code). In fact, I think it sends C++ source code to the g++ compiler (which is really the cc1plus.exe executable).
I have checked version 7.4 with a true C project (a simple console C program). The IsCpp flag is set to 0 and the CompileCpp=0 as well.
http://stackoverflow.com/questions/1516609/difference-between-cc-gcc-and-g