Take the 2-minute tour ×

lc----A tool to count lines of code in C files.

The make file of lc is given as below


# Objects we link together.
OBJ=lc.o get.o

all:    $(OBJ)
    $(CC) -o lc $(OBJ)

lc.o:   lc.c lc.h  
get.o:  get.c lc.h

I have the source on my desktop. So what should I enter on the shell command line. I have tried /home/desktop/lc/lc.c. It's not running.

share|improve this question

1 Answer 1

Your question is confusing, but it sounds like you have source code files. A .c file is meant for use by a compiler (like gcc) and not something that can be directly executed.

You need to compile them and then you'll get an executable, which is something you can run.

Try this:

  • Open a terminal
  • cd into the directory that has the make file
  • ls and see if there is a readme.txt or a docs or doc directory. Read any of those, or anything in those directories, it may give you specific instructions
  • Failing that, try entering make and see what happens. If it works you'll have an executable file called lc that you can run by entering ./lc.
share|improve this answer
how to get .o object files from shell prompt –  user7164 May 6 '11 at 12:04
i have given $ cc -o lc and the output is /usr/ucb/cc: language optional software package not installed –  user7164 May 6 '11 at 12:06
Your system is not set up as a development machine. You need to have a compiler to create executable code from the source code. Talk to your system administrator about getting you set up right. –  rettops May 7 '11 at 17:28

Your Answer


