Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Mar 2012 18:51:07 +0100
From:      Mel Flynn <rflynn@acsalaska.net>
To:        freebsd-ports@freebsd.org
Subject:   Re: installing GeoIP
Message-ID:  <4F54FD0B.9070401@acsalaska.net>
In-Reply-To: <CAKgQ7UJogA3iH=XiFGz46NBLTdj-bet=Bv=CWuuQeYsr0rXeuQ@mail.gmail.com>
References:  <CAKgQ7UJogA3iH=XiFGz46NBLTdj-bet=Bv=CWuuQeYsr0rXeuQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3/5/2012 18:37, Norman Khine wrote:

> $ gcc -lGeoIP example.c
> example.c:1:19: error: GeoIP.h: No such file or directory

> what am i missing?

Basic compiling flags when working with software that does not install
into default search paths:
cc -I/usr/local/include -L/usr/local/lib -o example example.c -lGeoIP
   [ CFLAGS/CPPFLAGS  ] [ LDFLAGS      ]    [ PROG] [ SRCS  ] [LDADD]

The brackets above refer to variable names in /usr/share/mk/bsd.prog.mk
which can be used by make(1) on stock FreeBSD. Example Makefile:

PROG=example
SRCS=example.c # optional, if not specified will assume ${PROG}.c
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
LDADD=-lGeoIP

.include <bsd.prog.mk>
-- 
Mel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F54FD0B.9070401>