gcc to compile c file that ends with ".C" (Capital C)

c, gcc

Solution

error trying to exec 'cc1plus'

Because `.C` is assumed to be a C++ source file (`cc1plus` is the C++ parser backend of GCC - by the way, it seems that your local installation of GCC lacks `g++` - are you using the default [incomplete] setup?).

To solve this, use the `-x` switch to force the language:

gcc -x c users/dubi/justPrnit.C

Problem

A weird behaviour when I shell: ``` bush@ubuntu:~/CPPWorkspace/Ex12$ gcc users/dubi/justPrnit.C ``` Returns an error: ``` gcc: error trying to exec 'cc1plus': execvp: No such file or directory ``` But when I change justPrnit.C to justPrnit.c (with little 'c') it compiled successfully. What's that?

Original source