Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Programming in Linux _ Compilation Error! Help!

Posted by: azul79 Aug 26 2004, 09:14 AM

hi!
i've been compiling rarpd .. for a couple of days.. and its always the same error!
PLEASE HELP!!
i'm getting crazy with this.. 'cause i dont know programming..
i 've been compiling rarp1.0 and 1.1,, just in case one was wrog.. but nop.. both give me the same error..
i 've previously compiled libnet 1.1.2.1 and libpcap (just rarp1.1 needs this)
anyway... both of them apparently without mistake..
but when i compile rarp-- this is what happens:

root@dodo:/usr/local/src/rarpd-1.1# ./configure
checking for libnet library in /usr/ng/lib... not found
checking for libnet library in /usr/lib... not found
checking for libnet library in /usr/local/lib... not found

its not finding libnet libraries. and dispite i give it the option of where to find them.. ( ./configure --with-libnet-lib=/usr/lib ... which by the way is where it is looking.. ) same thing happens when i do a "make"

root@dodo:/usr/local/src/rarpd-1.1# make
gcc -g -O2 -I/usr/include -DPACKAGE="" -DVERSION="" -DSTDC_HEADERS=1 -DHAVE_NET_IF_ARP_H=1 -DHAVE_PCAP_NAMEDB_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_CTYPE_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_PATHS_H=1 -c rarpd.c -o rarpd.o
rarpd.c: In function `send_rarpreply':
rarpd.c:289: `ARP_H' undeclared (first use in this function)
rarpd.c:289: (Each undeclared identifier is reported only once
rarpd.c:289: for each function it appears in.)
rarpd.c:289: `ETH_H' undeclared (first use in this function)
rarpd.c: In function `process_arp':
rarpd.c:334: structure has no member named `ar_sha'
rarpd.c:335: structure has no member named `ar_spa'
rarpd.c:336: structure has no member named `ar_tha'
rarpd.c:337: structure has no member named `ar_tpa'
rarpd.c: In function `main':
rarpd.c:449: warning: assignment makes pointer from integer without a cast
make: *** [rarpd.o] Error 1



AHHHHH!! i 'm getting crazy!!
'cause the libraries of libnet (libnet.a) are @/usr/lib/ and rarpd.c is loofing for them there.. but the same it says it doesnt find them!!

ANY HELP??? PLEASE!!

Posted by: Hemant Aug 26 2004, 09:30 AM

I am not sure..if it will work..but i will give you some hints.

1.add "/usr/local/lib" to "/etc/ld.so.conf" and execute command "/sbin/ldconfig".

2.Now try ./configure again.And see if it works this time.

3.I wonder.. when configuration step threw errors how you got a makefile.Check "./configure --help" and see what are the options that your configure file offers.Mostly the solution lies there.

4.Does your package also uses.."pkgconfig"??.If yes then i may have to suggest some more tips.

Posted by: azul79 Aug 27 2004, 07:51 AM

hi!! thnks! 4 answer!!

my file /usr/local/lib.. already is in /etc/ld.so.conf ...
i dont understand the error either..
the strange thing.. is that i googled a lot.. and nobody seems to be having this problems.. which seems to be a programming error..

my ackage.. doesnt use s pkgconfig ...
and my ./configure --help is this one.. :;

root@dodo:/usr/local/src/rarpd-1.1# ./configure --help
Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]
Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print `checking...' messages
--version print the version of autoconf that created configure
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[same as prefix]
--bindir=DIR user executables in DIR [EPREFIX/bin]
--sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
--libexecdir=DIR program executables in DIR [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data in DIR
[PREFIX/share]
--sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data in DIR
[PREFIX/com]
--localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
--libdir=DIR object code libraries in DIR [EPREFIX/lib]
--includedir=DIR C header files in DIR [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
--infodir=DIR info documentation in DIR [PREFIX/info]
--mandir=DIR man documentation in DIR [PREFIX/man]
--srcdir=DIR find the sources in DIR [configure dir or ..]
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM
run sed PROGRAM on installed program names
Host type:
--build=BUILD configure for building on BUILD [BUILD=HOST]
--host=HOST configure for HOST [guessed]
--target=TARGET configure for TARGET [TARGET=HOST]
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
--enable and --with options recognized:
--with-pcap=PREFIX Compile with PCAP support
--with-pcap-lib=dir use pcap libraries in dir
--with-pcap-include=dir use pcap headers in dir
--with-libnet=PREFIX Compile with LIBNET support
--with-libnet-config=dir use libnet config program in dir
--with-libnet-lib=dir use libnet libraries in dir
--with-libnet-include=dir use libnet headers in dir



i tried the option
./configure --with-libnet-lib=/usr/lib
and still the same...

the i added to rarpd.c a line to make it interpret the variable LIBNET_ARP_H as ARP_P and the same with ETH.. ' cause they are defined @libnet-headers.h as that..
and that seemed to work for the firs error...

but .. it still gives me:

rarpd.c: In function `process_arp':
rarpd.c:335: structure has no member named `ar_sha'
rarpd.c:336: structure has no member named `ar_spa'
rarpd.c:337: structure has no member named `ar_tha'
rarpd.c:338: structure has no member named `ar_tpa'
rarpd.c: In function `main':
rarpd.c:450: warning: assignment makes pointer from integer without a cast
make: *** [rarpd.o] Error 1


i checked for ar_sha and it isnamed @ /usr/include/net/if_arp.h
it seems to me that it is not finding the libraries..
sb told sth about dinacic and static libraries.. and that the problem might be.. that the libnet libraries are bieng created as static... but i dont know about this..
any mor help?
tnks!

Posted by: Hemant Aug 29 2004, 06:53 AM

So if you have installed libnet then,where are your libs.

i gues they are in /usr/local/lib..so try this...

CODE
#./configure --libdir=/usr/local/lib --includedir=/usr/local/include --with-libnet-lib=/usr/local/lib --with-libnet-lib-include=/usr/local/include


Make sure that you have both libnet headers and libraries installed in /usr/loca/lib and /usr/local/include.There may be a case where your libnet library is there in /usr/local/lib but it doens't have multiple links to itself.This is essential..

All the best..( I wish could be there at your end)

Posted by: azul79 Aug 30 2004, 08:17 AM

hey!
thnks a lot for your help!

i copied the libs where u told me.. and run configured as u said..
but still the same error when i run make .. sad.gif

root@dodo:/usr/local/src/rarpd-1.1# make
gcc -g -O2 -D_BSD_SOURCE -D__BSD_SOURCE -D__FAVOR_BSD -DHAVE_NET_ETHERNET_H -I/usr/include -I/usr/local/src/libnet/include -DPACKAGE="" -DVERSION="" -DSTDC_HEADERS=1 -DHAVE_NET_IF_ARP_H=1 -DHAVE_PCAP_NAMEDB_H=1 -DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_CTYPE_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_PATHS_H=1 -c rarpd.c -o rarpd.o
rarpd.c: In function `process_arp':
rarpd.c:335: structure has no member named `ar_sha'
rarpd.c:336: structure has no member named `ar_spa'
rarpd.c:337: structure has no member named `ar_tha'
rarpd.c:338: structure has no member named `ar_tpa'
rarpd.c: In function `main':
rarpd.c:450: warning: assignment makes pointer from integer without a cast
make: *** [rarpd.o] Error 1

my /etc/ld.so.conf file looks like this:

./usr/local/lib
/usr/X11R6/lib
/usr/i386-slackware-linux/lib
/opt/kde/lib
/usr/lib/qt/lib
/usr/local/include
/usr/include


the error it gives me.. "ar_sha" it at a file in /usr/include/net/if_arp as i told u..
where do u think the problem might be ? sad.gif
thanks a lot!

Posted by: Hemant Sep 1 2004, 03:54 AM

How did the configuration step go???
Have you tried to configure using the options suggested by me.

Posted by: azul79 Sep 1 2004, 07:28 AM

yes i did..
nothing works ..
i copied libnet libraries everywhere.. and despite being there rarpd doenst find them!!! so it ends saying..
that it's not going to include libnet..
if i put the option of including klibnet in the ./configure step...
but the same.. it gives me the same error

rarpd.c: In function `process_arp':
rarpd.c:341: structure has no member named `ar_sha'
rarpd.c:342: structure has no member named `ar_spa'
rarpd.c:343: structure has no member named `ar_tha'
rarpd.c:344: structure has no member named `ar_tpa'
rarpd.c: In function `main':
rarpd.c:456: warning: assignment makes pointer from integer without a cast
make: *** [rarpd.o] Error 1

my guess is that rarpd doesnt recognise that the library is that..
the library is libnet.a (static library as i was told..)
i was told to look for libnet.so .. the dinamic library.. i dont understand haw static and dinamic libraries work..
do u know about it?
im gonna try that and let u know!!
thanks a lot..

Posted by: azul79 Sep 1 2004, 08:47 AM

sad.gif
i downloaded libnet.so ,, and still not working ..
checking for libnet library in /usr/ng/lib... not found
checking for libnet library in /usr/lib... not found
checking for libnet library in /usr/local/lib... not found
checking for libnet header in /usr/ng/include... not found
checking for libnet header in /usr/include... found
checking whether to include libnet... no
always the same message.
i'm getting crazy with this!!
i dont understand why??
nobody appears to have this problem!!
why me??? sad.gif
HELP PLEASE!!

Posted by: Hemant Sep 12 2004, 12:49 PM

Recently i was some same sort of problem...And my method was ok sort of.
So here is what i did.
You have problems with libnet library right???It is installed but when you try to install rarp package it is not able to find the installed libnet library.

So what you can do is...you can give links to all the libnet files (i mean .so and header files) in /usr/lib and /usr/include.I have successfully solved my problem using this method.But make sure you don't have any conflicts!!!!

And then for your rarp installation go ahead with configure,make,make install.

This should work.

Posted by: azul79 Sep 12 2004, 01:04 PM

so --.. what you mean is that i should do a link from the library @/usr/lib to somewhere else..
or at the same dir (/usr/lib/) a link from libnet.a --> libnet.so ? (for example?)

Posted by: Hemant Sep 13 2004, 09:49 PM

Ok..let's proceed step by step..
step1
Have you installed libnet libraries??
What is the output of command..
$cd /; find .|grep -i libnet
step2

if you have installed libnet libraries and let's say...
libnet.so.x files are in /usr/local/lib and header files of libnet libraries are in /usr/local/include then what i suggest is...
step3
Make soft link for all the libnet.so files from /usr/local/lib to /usr/lib using command.
$cd /usr/lib
$ln -s /usr/local/lib/libnet.so .
$ln -s /usr/local/lib/libnet.so.* .

and after that make links for header files...
$cd /usr/include
$ln -s /usr/local/include/libnet* .

But while making links to header files you have to be careful..first of all check out the content of /usr/local/include and see if all the libnet header files are in a sub-directory or they are in /usr/local/include itself.If they are inside a sub-directory of /usr/local/include then make a link of sub-directory only.Or else follow the earlier command.

And then proceed with configure,make,make install for your rarp package.

Posted by: azul79 Sep 14 2004, 08:15 AM

hey!
thanks for your help!
finally.. it seems to be that itsnot a library problem.. i looked at the configure script and followed line by line ... the thing was that it wasnt entering to an " if " instruction.
i forced it to enter there and then it found the libraries..
the thing is that .. when i run MAKE it gives me lot of errors... i write on the rarpd.c a couple of things.. (paths to libraries and so on.. )
but nothing seems to work.
rapd.c does not get along with libnet headers .. the code its not compatible ..
variables defined on rarpd.c are not defined in the same way in libnet-headers.h
i am in the edge of giving it up--

anyway... thanksa lot for your help! !! smile.gif biggrin.gif

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)