Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Compile C files with g++ rather than gcc
Compile C files with g++ rather than gcc [message #1850199] Mon, 21 February 2022 14:10 Go to next message
Parker Newman is currently offline Parker NewmanFriend
Messages: 1
Registered: February 2022
Junior Member
Anyone know the best way to get eclipse to compile .c files with g++ rather than gcc?
Re: Compile C files with g++ rather than gcc [message #1850206 is a reply to message #1850199] Mon, 21 February 2022 16:39 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 725
Registered: August 2014
Senior Member
Would you please tell why?

--

Tauno Voipio
Re: Compile C files with g++ rather than gcc [message #1850277 is a reply to message #1850206] Wed, 23 February 2022 15:53 Go to previous message
David VavraFriend
Messages: 1430
Registered: October 2012
Senior Member
g++ is a frontend for the GNU Compiler Suite.
It is essentially the equivalent of gcc -xc++

If you are asking how to compile a C program with g++ you could
try to override it with the -x flag (-xc). Not sure if it will work.

If you meant compile a C++ program with a .c extent, you could
just use g++ and add the -x flag to be sure.

Seems easier to use gcc or g++ as appropriate.

You could also change the Eclipse file associations but that
would open a potential can of worms.
Previous Topic:CDT Debug not reading EOF from console
Next Topic:building C/C++ hello world
Goto Forum:
  


Current Time: Wed Aug 10 20:50:35 GMT 2022

Powered by FUDForum. Page generated in 0.01445 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top