DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 15th July 2008
kasse kasse is offline
Fdisk Soldier
 
Join Date: Jun 2008
Posts: 67
Thanked 0 Times in 0 Posts
Default What include and shared library directories are searched by gcc

Hello I have a question concerning gcc with f2c files and where gcc looks for include and shared library directories. Perhaps this should be in the programming section but since the problem only occurs in freebsd and I did not intend to do programming, I hope that I can ask it here.
The problem is that I want to compile foo.c which is the output from f2c program. The makefile make.sh is as follows
Code:
 gcc -03 -o oscillator oscillator.c -lf2c -lm
but gcc complains that it cannot find the f2c.h so I look up where f2c.h is
Code:
 /usr/local/inclucde
and change the make file to
Code:
 gcc -03 -o oscillator oscillator.c -I/usr/local/include -lf2c -lm
then in complains that it cannot find lf2c so I check with
Code:
 ldconfig -r | grep lf2c
and I get
Code:
 531:-lf2c.2 => /usr/local/lib/libf2c.so.2
and I change the makefile to
Code:
gcc -03 -o oscillator oscillator.c -I/usr/local/include -L/usr/local/lib -lf2c -lm
and now it compiles.
So my question are
1)why gcc does not look in the /usr/local for include files and why if ldconfig had lf2c linked why did gcc not find the file.
2) how can I change so that gcc looks for include and library files in /usr/local
3) Is the gcc in /usr/bin the same as /usr/local/gccXX, what I can see it is not a link
Reply With Quote
 

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shared object not found 'libwrap.so.4' magic FreeBSD General 3 22nd July 2009 09:36 PM
Is /usr/X11R6/include/ supposed to be in $CPATH kasse OpenBSD General 4 3rd December 2008 05:34 PM
shared libraries and linux emulation Business_woman FreeBSD General 4 16th November 2008 10:03 AM
/usr/local and application directories ducu_00 FreeBSD Ports and Packages 14 23rd May 2008 05:37 PM
Home directories suddenly missing in Samba Dagoles FreeBSD General 4 22nd May 2008 12:50 AM


All times are GMT. The time now is 11:51 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick