Announcement

Collapse
No announcement yet.

gcc-4.2: error trying to exec 'cc1obj': execvp: No such file or directory

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    gcc-4.2: error trying to exec 'cc1obj': execvp: No such file or directory

    Hi,

    I am trying to compile an objective c program from a terminal with this line:

    gcc main.m -o Prog1 -l objc

    and also this one

    gcc-4.2 main.m -o Prog1 -l objc

    both give this error

    gcc-4.2: error trying to exec 'cc1obj': execvp: No such file or directory

    I have both gcc and gcc-4.2 installed and have run apt-get install build-essential but still have the same error.

    Can anyone help me please?

    Thanks

    #2
    Re: gcc-4.2: error trying to exec 'cc1obj': execvp: No such file or directory

    your question has taken me to my reference books as I have not used gcc or c for a very long time but shouldn't the -o come immediately after gcc? The name for the target program comes next then the name of the source code programme so

    gcc -o Prog1 main.m (sorry I can't read the next letter on my screen)

    but your best bet is to read the online documentation at

    http://www.gnu.org/software/gcc/onlinedocs/

    hope this helps.

    Roy

    Comment


      #3
      Re: gcc-4.2: error trying to exec 'cc1obj': execvp: No such file or directory

      Hi,

      thanks for the reply. I tried your way to no avail. The snippet I posted is as it appears in the book I am studying with, Programming in Objective C by Stephen Kochan.

      I searched and searched and came across a post out there in web land that mentioned the need for gobjc to be installed.

      So I looked up gobjc-4.2 and it was not installed!

      Installed it and hey presto it works!

      Comment

      Working...
      X