Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
3  
You should do "chmod +x 13.out", no? and execute "./13.out" –  Balder Oct 11 '12 at 5:28
    
thanks @Balder! It worked! –  tranjeeshan Oct 11 '12 at 5:31
add comment

Your Answer

 
discard

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.