LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-13-2007, 02:31 PM   #1
wendea
Member
 
Registered: Mar 2007
Distribution: Fedora
Posts: 81

Rep: Reputation: 15
Smile gcc


Im trying to compile a program through gcc called primes. I have the code for FC6 but im running FC5. The command for FC6 is:

gcc -O primes.cr.c -lgmp -o primes

Whenever I run it I get a error saying:

primes.cr.c:3:16: error: gmp.h: No such file or directory
primes.cr.c: In function ‘main’:
primes.cr.c:7: error: ‘mpz_t’ undeclared (first use in this function)
primes.cr.c:7: error: (Each undeclared identifier is reported only once
primes.cr.c:7: error: for each function it appears in.)
primes.cr.c:7: error: expected ‘;’ before ‘n’
primes.cr.c:9: error: ‘n’ undeclared (first use in this function)
primes.cr.c:10: error: ‘st’ undeclared (first use in this function)
primes.cr.c:11: error: ‘j’ undeclared (first use in this function)
primes.cr.c:12: error: ‘g’ undeclared (first use in this function)
primes.cr.c:13: error: ‘k’ undeclared (first use in this function)

I believe that thats part of the file that gets the error. Although it got downloaded on another computer fine. So the file is not corrupted for the other computer. However the other file is running FC6.

Any suggestions?

Thanks
 
Old 03-13-2007, 02:54 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
You need to install gmp
 
Old 03-13-2007, 05:08 PM   #3
wendea
Member
 
Registered: Mar 2007
Distribution: Fedora
Posts: 81

Original Poster
Rep: Reputation: 15
And how do I do that or where do I get that?
 
Old 03-14-2007, 02:20 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
http://gmplib.org/
 
Old 03-14-2007, 01:38 PM   #5
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
Or you might use fedora’s package manager to install libgmp or whatever they call it.
 
Old 03-15-2007, 01:17 PM   #6
wendea
Member
 
Registered: Mar 2007
Distribution: Fedora
Posts: 81

Original Poster
Rep: Reputation: 15
ok that helped alot, I used that site. thatnylex supplied. I used it and it worked thanks for all your help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
have gcc compilation error during gcc installtion in linuxfromscratch vbshanmugaprakash Linux - General 3 12-13-2006 06:52 AM
LXer: Tools: GCC 3.4.6, Final GCC 3 Release LXer Syndicated Linux News 0 05-30-2006 03:21 AM
gcc wont install, 'failed dependencies: glibc-devel is needed by gcc-3.3.3-41' TdlSnare SUSE / openSUSE 3 11-29-2004 03:13 PM
Kernel compiling: gcc-3.3 is 586, should be gcc-3.3 386 Erik Plaggenmar Linux - Software 0 10-01-2004 12:38 PM
export CC=/usr/bin/gcc-3.2 - switch gcc version? ferreter Linux - Software 1 08-20-2003 01:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration