![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is difference between GCC and G++ Compilers?
We use gcc and g++ compilers in different times. Here we will see what are the differences between gcc and g++.
The gcc is GNU C compiler, and g++ is GNU C++ compiler. The main differences are like below −
- gcc can compile *.c or *.cpp files as C and C++ respectively
- g++ can also compile *.c and *.cpp files, but take both as C++ file
- If we want to use g++ to link the object files, it automatically links in the STD C++ libraries. The gcc does not do that
- gcc compiles C files which has fewer predefined macros
- gcc compiles C++ files with more number of predefined macros, and also g++ compiles with more predefined macros.
The extra macros for C++ files are like below −
#define __GXX_WEAK__ 1 #define __cplusplus 1 #define __DEPRECATED 1 #define __GNUG__ 4 #define __EXCEPTIONS 1 #define __private_extern__ extern
Advertisements