Sign-in / Sign-up
Your question
Closed

How to compile a file in unix or linux

Tags:
  • Compile
  • Unix
  • Command Prompt
  • Linux
Last response: in Open Source Software
March 21, 2012 1:53:41 PM

I want to know if unix allows to compile a file and if yes what is the command?
Please help

More about : compile file unix linux

a c 136 5 Linux
March 21, 2012 3:20:38 PM

yes, what file? normally you need at least gcc, make (and sometimes autotools)
Score
0

Best solution

a b 5 Linux
March 21, 2012 3:39:27 PM

Generally if you download a tarball containing source code, it's something like this. As skittle said, it kind of depends on the download.

tar xvf [tarball name]
cd [new directory name]
./configure
make
make install
Share
Related resources
Can't find your answer ? Ask !
a b 5 Linux
March 21, 2012 5:43:58 PM

Correction:

sudo make install
Score
0
a b 5 Linux
March 21, 2012 10:22:01 PM

Thanks, was just doing it off the top of my head :D 
Score
0
May 4, 2012 3:54:55 AM

Abhishekd said:
I want to know if unix allows to compile a file and if yes what is the command?
Please help

$ gcc -g foo.c -o foo
This works on my pcBSD 8.2 Hubble using gcc and fedora gcc
the -g is for debugging in gdb and the -o is for optomizei
Score
0
May 4, 2012 5:24:17 AM

when you extract the archive it usually contains a readme with installation instructions. be advised that most of the time your program has already been compiled and you can install it from your distro's repository or use a 3rd party repository. you can also install binary files that end in .deb for debian and ubuntu derivatives or rpm for fedora
Score
0
a b 5 Linux
May 4, 2012 6:08:49 AM

Best answer selected by amdfangirl.
Score
0
a b 5 Linux
May 4, 2012 6:08:54 AM

Don't necro.

It's bad for you.
Score
0