I've recently swithed from borland C++ 5.5 to MinGW. When I try to compile a .c file using gcc it compiles fine, but when I try to compile a .cpp file using gcc it produces a bunch of errors with c++ specific constructs. If I compile .cpp files with g++ then it works fine. My question is should not gcc call appropriate compilers based on the file extensions? Why does it work for .c files and not for .cpp files. As far as I knew gcc stands for GNU Compiler Collection and it should invoke appropriate compilers on its own. Why is it acting just like a C only compiler?
Asif_NSU 25 Posting Whiz
Narue 5,707 Bad Cop Team Colleague
SpS 34 Posting Pro
Asif_NSU 25 Posting Whiz
Narue 5,707 Bad Cop Team Colleague
kawk 0 Newbie Poster
dwks 149 Posting Whiz in Training
Asif_NSU 25 Posting Whiz
perniciosus 19 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.