Author Topic: How to compile only in C Mode only. Using GCC compiler  (Read 5260 times)

Offline JasonC

  • Single posting newcomer
  • *
  • Posts: 2
How to compile only in C Mode only. Using GCC compiler
« on: August 08, 2013, 05:45:09 pm »
I am not able to determine how to build only using the C compiler (GCC, via MinGw32-gcc.exe). 

Take this very basic project, all syntax is in C, it has one resource file, 1 image in a .res file, and one source file (end in .c), the g++ compiler is the one that ultimately produces the output exe.

The output of the build is as follows:
mingw32-gcc.exe -Wall  -O     -c C:\Users\me\Documents\Simple\Test1\main.c -o obj\Debug\main.o
windres.exe  -J rc -O coff -i C:\Users\me\DOCUME~1\Simple\Test1\resource.rc -o obj\Debug\resource.res
mingw32-g++.exe -Wall  -O     -c C:\Users\me\Documents\Simple\Test1\image1.bmp -o obj\Debug\image1.o
mingw32-g++.exe  -o bin\Debug\Test1.exe obj\Debug\main.o  obj\Debug\resource.res   -lgdi32 -luser32 -lkernel32 -lcomctl32  -mwindows
Output size is 37.10 KB

I would prefer to use the C compiler, and not C++, since I don't have any specific C++ code.  Am I able to force or use just the C compiler, or is there another reason why the C++ compiler is invoked?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11716
    • Travis build status
Re: How to compile only in C Mode only. Using GCC compiler
« Reply #1 on: August 08, 2013, 05:49:11 pm »
If you never intend to link c++ programs, you can replace g++ with gcc for linking in the Toolchain setting of the compiler.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline JasonC

  • Single posting newcomer
  • *
  • Posts: 2
Re: How to compile only in C Mode only. Using GCC compiler
« Reply #2 on: August 08, 2013, 05:54:48 pm »
Thank you.  That is a good consideration to keep in mind.  This answers my question.