Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have problems related to C programming on Ubuntu 12.04. While compiling C program consisting pow I faced difficulties. Then I searched the Internet and got the solution with -lm. But that's the compiling part. How to execute and Run that program that has pow in it? I failed to execute and run. The message said No such file or directory. What can I do?

Again, is there any easy way of learning C programming on Ubuntu, where I can fully concentrate on coding? I prefer not to have to think about compiling, executing and running the code. Should I use an IDE for that? What do you say?

share|improve this question
up vote 2 down vote accepted

The problem using the functin pow is that it's a function from another library, not from the C language. So, you need to link to the math library. But I don't get why you can't run the program. What complete command are you using to compile and what to run?

About using an IDE, I recommend you not to use it while you're learning, or you can miss the undestanding of how everything works.

share|improve this answer
"gcc -Wall 13.c -o 13.out -lm" "chmod +x 13" "./13" These are the codes I used for compiling, executing and running my code. It compiled I think, but failed to execute and run. The message says 'No such file or directory'. – tranjeeshan Oct 11 '12 at 5:26
You should do "chmod +x 13.out", no? and execute "./13.out" – Dielson Sales Oct 11 '12 at 5:28
thanks @Balder! It worked! – tranjeeshan Oct 11 '12 at 5:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.