problem installing gmp

Installing and maintaining the FreeBSD Ports Collection or FreeBSD Packages (i.e. third party software).

problem installing gmp

Postby jnb » 12 Dec 2010, 00:31

hey guys I've just installed gmp 5 via ports but it doesn't work! when I compile a gmp program it complains it can't find gmp.h.

i've even tried passing
Code: Select all
-I/usr/local/include
(where the header actually is) but i still get the error:

Code: Select all
/usr/bin/ld: cannot find -lgmp


Any thoughts on this one? I'm using FreeBSD 8.1-RELEASE-p1. Thanks!
jnb
Junior Member
 
Posts: 14
Joined: 27 Jun 2010, 15:44

Postby wblock@ » 12 Dec 2010, 00:46

Your error message says it's looking for "-lgmp", so you maybe have an extra "-l"?
User avatar
wblock@
Old Fart
 
Posts: 10226
Joined: 07 Sep 2009, 23:23
Location: Milky Way galaxy

Postby jrm » 12 Dec 2010, 06:11

Does the following work for you?
Code: Select all
gcc -Wall -I/usr/local/include -L/usr/local/lib -lgmp test.c
User avatar
jrm
Member
 
Posts: 733
Joined: 16 Nov 2008, 17:32
Location: 44.6475,-63.5805

Postby jnb » 12 Dec 2010, 18:11

Hey! Thank you all for your quick replies. Yes if I include

Code: Select all
-L/usr/local/lib


all goes well. But shouldn't these paths be included in gcc's default search paths? if not, how can I include them?

Thanks.
jnb
Junior Member
 
Posts: 14
Joined: 27 Jun 2010, 15:44

Postby jrm » 12 Dec 2010, 20:19

[FILE]/usr/local/include[/FILE] and [FILE]/usr/local/lib[/FILE] used to be in gcc's default search paths, but they aren't now for some reason. Maybe someone knows why? You can set the environment variables
Code: Select all
C_INCLUDE_PATH
and
Code: Select all
LIBRARY_PATH
.
User avatar
jrm
Member
 
Posts: 733
Joined: 16 Nov 2008, 17:32
Location: 44.6475,-63.5805

Postby jrm » 12 Dec 2010, 23:12

After a little test... The system gcc looks, by default, in [FILE]/usr/include[/FILE] and [FILE]/usr/lib[/FILE], which makes sense; it's the system compiler. gcc45, installed from ports, looks, by default, in [FILE]/usr/local/include[/FILE] and [FILE]/usr/local/lib[/FILE].
User avatar
jrm
Member
 
Posts: 733
Joined: 16 Nov 2008, 17:32
Location: 44.6475,-63.5805

Postby jnb » 13 Dec 2010, 12:14

Thanks for all your help mingrone! I'll install gcc 4.5 and give it a go!
"UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity." - Dennis Ritchie
jnb
Junior Member
 
Posts: 14
Joined: 27 Jun 2010, 15:44


Return to Installation and Maintenance of FreeBSD Ports or Packages

Who is online

Users browsing this forum: No registered users and 1 guest