installing GeoIP

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

installing GeoIP

Norman Khine
Hello,
I have installed the GeoIP port from ports/net/GeoIP/, using:

# make all install clean

but when i run the example from the website, i get this error:


$ gcc -lGeoIP example.c
example.c:1:19: error: GeoIP.h: No such file or directory
example.c: In function 'main':
example.c:3: error: 'GeoIP' undeclared (first use in this function)
example.c:3: error: (Each undeclared identifier is reported only once
example.c:3: error: for each function it appears in.)
example.c:3: error: 'gi' undeclared (first use in this function)
example.c:4: error: 'GEOIP_STANDARD' undeclared (first use in this function)
example.c:5: warning: incompatible implicit declaration of built-in
function 'printf'

what am i missing?

thanks
--
%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: installing GeoIP

Mel Flynn-10
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
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: installing GeoIP

Norman Khine
hi thank you for this.

so in order to build https://github.com/kuno/GeoIP into freebsd, as i
get this issue: https://github.com/kuno/GeoIP/issues/33

i am really not sure why that is not working.



On Mon, Mar 5, 2012 at 6:51 PM, Mel Flynn <[hidden email]> wrote:

> 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
> _______________________________________________
> [hidden email] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "[hidden email]"



--
%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: installing GeoIP

Norman Khine
when i run

$ /usr/bin/ld -lGeoIP
/usr/bin/ld: cannot find -lGeoIP

perhaps i have a problem with the settings of my location of the
headers in my linker path.

how do i verify this?

or is it a problem with https://github.com/kuno/GeoIP ?

On Mon, Mar 5, 2012 at 7:16 PM, Norman Khine <[hidden email]> wrote:

> hi thank you for this.
>
> so in order to build https://github.com/kuno/GeoIP into freebsd, as i
> get this issue: https://github.com/kuno/GeoIP/issues/33
>
> i am really not sure why that is not working.
>
>
>
> On Mon, Mar 5, 2012 at 6:51 PM, Mel Flynn <[hidden email]> wrote:
>> 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
>> _______________________________________________
>> [hidden email] mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
>> To unsubscribe, send any mail to "[hidden email]"
>
>
>
> --
> %>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or
> chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )



--
%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: installing GeoIP

Ade Lovett
On 3/5/2012 10:32, Norman Khine wrote:
> when i run
>
> $ /usr/bin/ld -lGeoIP
> /usr/bin/ld: cannot find -lGeoIP
>
> perhaps i have a problem with the settings of my location of the
> headers in my linker path.
>
> how do i verify this?

As has already been explained.  -I/usr/local/include (to find the
header(s)) and -L/usr/local/lib (to find the library)

cc -I/usr/local/include -o example example.c -L/usr/local/lib -lGeoIP

This is "Compilation of Stuff 101" -- it most likely isn't an issue on
Linux, since there's a tendency to just stuff everything in
/usr/include, /usr/lib and friends which will be poked at by the
compiler by default.

-aDe

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: installing GeoIP

Norman Khine
so the problem is not my freebsd box but the package GeoIP that does
not buid on my box?

as when i do this:

$ npm install geoip
    npm WARN node-static@0.5.9 dependencies field should be hash of
<name>:<version-range> pairs
    npm WARN riak-js@0.4.1 package.json: bugs['web'] should probably
be bugs['url']
    npm http GET https://registry.npmjs.org/geoip
    npm http 304 https://registry.npmjs.org/geoip

    > geoip@0.4.5 preinstall /home/khine/sandboxes/livestats/node_modules/geoip
    > node-waf clean || (exit 0); node-waf configure build

    Nothing to clean (project not configured)
    Checking for program g++ or c++          : /usr/bin/g++
    Checking for program cpp                 : /usr/bin/cpp
    Checking for program ar                  : /usr/bin/ar
    Checking for program ranlib              : /usr/bin/ranlib
    Checking for g++                         : ok
    Checking for node path                   : not found
    Checking for node prefix                 : ok /home/khine
    'configure' finished successfully (0.019s)
    Waf: Entering directory
`/home/khine/sandboxes/livestats/node_modules/geoip/build'

so, would i need to change this file
https://github.com/kuno/GeoIP/blob/master/wscript as is not finding
the correct paths to the llibrararies?


On Mon, Mar 5, 2012 at 7:45 PM, Ade Lovett <[hidden email]> wrote:

> On 3/5/2012 10:32, Norman Khine wrote:
>>
>> when i run
>>
>> $ /usr/bin/ld -lGeoIP
>> /usr/bin/ld: cannot find -lGeoIP
>>
>> perhaps i have a problem with the settings of my location of the
>> headers in my linker path.
>>
>> how do i verify this?
>
>
> As has already been explained.  -I/usr/local/include (to find the header(s))
> and -L/usr/local/lib (to find the library)
>
> cc -I/usr/local/include -o example example.c -L/usr/local/lib -lGeoIP
>
> This is "Compilation of Stuff 101" -- it most likely isn't an issue on
> Linux, since there's a tendency to just stuff everything in /usr/include,
> /usr/lib and friends which will be poked at by the compiler by default.
>
> -aDe
>



--
%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: installing GeoIP

Ade Lovett
On 3/5/2012 12:05, Norman Khine wrote:
> so the problem is not my freebsd box but the package GeoIP that does
> not buid on my box?
>
> as when i do this:
>
> $ npm install geoip

'npm' (whatever the hell that is) has precisely nothing to do with
FreeBSD ports/  -- go bug the maintainers.

> [snip]
> so, would i need to change this file
> https://github.com/kuno/GeoIP/blob/master/wscript as is not finding
> the correct paths to the llibrararies?

No idea.  Honestly, don't particularly care, either.  You've been given
the necessary incantations for a piece to compile/link against an
installed port/package.  Multiple times.  It is now entirely up to you
to determine how to apply that information to whatever build system it
is that you have.  I'm sure they have a development list.
freebsd-ports@ isn't it.

-aDe
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"