LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need to compile ANSI-C code, is there a compiler on FC8 for it? (http://www.linuxquestions.org/questions/linux-newbie-8/need-to-compile-ansi-c-code-is-there-a-compiler-on-fc8-for-it-743853/)

Azazwa 07-30-2009 03:07 AM

Need to compile ANSI-C code, is there a compiler on FC8 for it?
 
Hi!

Someone I know has a program seemingly written in ANSI-C, which he wants to compile and link to another program's binaries.
He asked me whether I have a compiler, and I have a vague feeling that there should be a default compiler that comes with Fedora 8.

So, which compiler would be best to use?
How do I get hold of it on my computer?
Do I just take the source files and run a few commands on it. (I vaguely recall something like, "make" with a few flags or something) ?

Any info would be welcome.

Thanks

;-)

karamarisan 07-30-2009 03:19 AM

It's probably not installed right now - you should run `sudo yum install gcc`, which will give you the C compiler gcc (as well as several others). If the files you get from your acquaintance include files called 'configure' and 'Makefile', the make three commands are `./configure` (performed wherever those files are), `make`, and `make install`. If you've just got a couple source files, you may need to just run gcc directly on them. If you're not sure, change to the directory where you have those files, run `ls -l`, post the output of that here, and we can definitely clear it up for you.

Azazwa 07-30-2009 03:31 AM

Hi!

Thanks for the quick reply. I tried doing `yum install gcc` as the root, because it said that my normal user was not part of the sudoers, or something like that. Then it said "Another app is currently holding the yum lock; waiting for it to exit..." From another terminal I killed the process. Is this normal? Should I just leave it, and not kill the process?

karamarisan 07-30-2009 03:48 AM

My bad on the sudo part - you can easily find an explanation of how to do this, but in short, you can enable sudo by running visudo as root and uncommenting (removing the % from) a line that will be labeled as providing this and then running `usermod -G wheel <yournormalusername>`. Don't use the NOPASSWD version of the line (for security reasons) and make sure that G's a capital G.

As for yum, it should tell you the name of that process. If it was just PackageKit, it's okay to kill it. By default, Fedora has a process running that will check updates for you periodically. If you've got a many-pointed star in your notification area that talks about updates when you click on it, that's what I'm talking about.

One more thing - why Fedora 8? It's not receiving updates anymore, so unless it's impossible, you should upgrade to F11 before you get comfortable.

Azazwa 08-26-2009 07:33 AM

Hi!

I'm a chemistry student and for my project last semester I built a small cluster. Fedora 8 was necessary because of the chemical software we're running on it. I would have upgraded it if it was my own PC. Sorry for the long silence, I'm working in the lab this semester and I have less time to hang around computers. I'll follow your advice and keep you updated when the time allows it.

Thanks!


All times are GMT -5. The time now is 08:09 PM.