problem installing gmp

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:
-I/usr/local/include
(where the header actually is) but i still get the error:

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

Any thoughts on this one? I'm using FreeBSD 8.1-RELEASE-p1. Thanks!
 
Does the following work for you?
Code:
gcc -Wall -I/usr/local/include -L/usr/local/lib -lgmp test.c
 
Hey! Thank you all for your quick replies. Yes if I include

Code:
-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.
 
/usr/local/include and /usr/local/lib 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:
C_INCLUDE_PATH
and
Code:
LIBRARY_PATH
.
 
After a little test... The system gcc looks, by default, in /usr/include and /usr/lib, which makes sense; it's the system compiler. gcc45, installed from ports, looks, by default, in /usr/local/include and /usr/local/lib.
 
  • Thanks
Reactions: jnb
Thanks for all your help mingrone! I'll install gcc 4.5 and give it a go!
 
Back
Top