Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

Where is inet_aton, inet_addr, etc.

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> Where is inet_aton, inet_addr, etc. Page: [1]
Login
Message << Older Topic   Newer Topic >>
Where is inet_aton, inet_addr, etc. - Aug. 26, '04, 11:14:03 AM   
j1mw3b

 

Posts: 11
Joined: Aug. 13, '04,
Status: offline
I am compiling rdate and am getting the following undefined. inet_aton is defined in /usr/include/arpa/inet.h, but it is defined to `___inet_aton' which is nowhere to be found. Then just following the #define is the prototype for inet_aton, but it won't be used.
Before closely examining the arpa/inet.h, I just tried to convert the rdate back to use inet_addr, and of course, it has the same issue.
Am I just missing something here?

/dev/fs/D/src/rdate/rdate-1.4/rdate.c:108: undefined reference to `___inet_aton'
/dev/fs/D/src/rdate/rdate-1.4/rdate.c:113: undefined reference to `___inet_addr'

_____________________________

Thanks,

Jim
Post #: 1
RE: Where is inet_aton, inet_addr, etc. - Aug. 26, '04, 12:08:01 PM   
j1mw3b

 

Posts: 11
Joined: Aug. 13, '04,
Status: offline
I went and got ftp 3.2a source and compiled it. It does not get the undefineds like rdate does, but it does get other errors; but that's another issue.

Now, I sez to myself, why does ftp.c compile OK with a reference to inet_ntoa (which is defined to ___inet_ntoa?

_____________________________

Thanks,

Jim

(in reply to j1mw3b)
Post #: 2
RE: Where is inet_aton, inet_addr, etc. - Aug. 26, '04, 12:48:18 PM   
Rodney

 

Posts: 2916
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Which packages do you have installed from /Tools ?
In particular do you have the bind package installed?

You may have with your compile "-I/usr/local/include" but not "-L/usr/local/lib".
So you may be picking up /usr/local/include/arpa/inetd.h first which does do
the mapping to "__". Either drop the "-I/usr/local/include" or add "-L/usr/local/lib".
(This is assuming you've installed BIND 9).

(in reply to j1mw3b)
Post #: 3
RE: Where is inet_aton, inet_addr, etc. - Aug. 26, '04, 5:49:19 PM   
j1mw3b

 

Posts: 11
Joined: Aug. 13, '04,
Status: offline
Thanks for reply...

I have bind 8.4.1 installed. Shoot, I installed everything in sight.
I am a little baffled.
Oh, BTW, there's also no inttypes.h but I was able to remove that and I think, get past it.

I did find inet_aton in /usr/local/include/bind/inet but it too is defined to ___inet_aton.

Here's my make with -I/usr/local/include AND -L/usr/local/line that errors (I also tried it with -I/usr/local/include/bind):

gcc -o rdate rdate.c -g -Wall -pipe -D`uname` -D_ALL_SOURCE -Dunix -DAUTO_FETCH -I/usr/local/include -L/usr/local/lib -D_GNU_SOURCE
rdate.c: In function `rdate':
rdate.c:228: warning: passing arg 5 of `recvfrom' from incompatible pointer type
rdate.c:104: warning: unused variable `rc'
/tmp/ccnBvl5r.o(.text+0x126): In function `rdate':
/dev/fs/D/src/rdate/rdate-1.4/rdate.c:119: undefined reference to `___inet_addr'
collect2: ld returned 1 exit status


Here's the make without the extra -I and -L:

gcc -o rdate rdate.c -g -Wall -pipe -D`uname` -D_ALL_SOURCE -Dunix -DAUTO_FETCH -D_GNU_SOURCE
rdate.c: In function `rdate':
rdate.c:228: warning: passing arg 5 of `recvfrom' from incompatible pointer type
rdate.c:104: warning: unused variable `rc'
/tmp/ccAW5CEo.o(.text+0x126): In function `rdate':
/dev/fs/D/src/rdate/rdate-1.4/rdate.c:119: undefined reference to `___inet_addr'
collect2: ld returned 1 exit status
*** Error code 1

Here's the one from ftp package which compiles ftp.c (which has inet_ntoa, etc) with no error in the compile.
gcc -g -I/usr/local/include -L/usr/local/lib -D_ALL_SOURCE -Dunix -DAUTO_FETCH -c ftp.c

_____________________________

Thanks,

Jim

(in reply to Rodney)
Post #: 4
RE: Where is inet_aton, inet_addr, etc. - Aug. 26, '04, 7:55:27 PM   
j1mw3b

 

Posts: 11
Joined: Aug. 13, '04,
Status: offline
I missed the bind 9 requirement; and so went and installed it. Same results.

_____________________________

Thanks,

Jim

(in reply to j1mw3b)
Post #: 5
RE: Where is inet_aton, inet_addr, etc. - Aug. 27, '04, 12:17:34 PM   
Rodney

 

Posts: 2916
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Okay, don't use the includes in /usr/local/include/bind.
It gets confusing, but these are the BIND 8 include files that shipped with 3.5.
The problem is there was no adjustment made to them.
With BIND 9 installed on your system -I/usr/local/include and -L/usr/local/lib
should be fine.

Who's rdate are you attempting to use?
I can only assume there's something in the code at this point.

(in reply to j1mw3b)
Post #: 6
RE: Where is inet_aton, inet_addr, etc. - Aug. 27, '04, 1:35:05 PM   
Rodney

 

Posts: 2916
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Well, I used the BSD rdate as a trial and ported it.
The port is to turn off IPv6 and skip adjusttime().
I updated the man page too. The example points to an open NTP
server (a Swiss clock of course :-) ).
So I've made it as a package you can just install if you want:
pkg_add ftp://ftp.interopsystems.com/pkgs/3.5/rdate-current-bin.tgz


But we can continue this thread too to narrow down why things are awry for you.
Let us know which rdate source you are using.

(in reply to Rodney)
Post #: 7
RE: Where is inet_aton, inet_addr, etc. - Aug. 27, '04, 4:36:08 PM   
j1mw3b

 

Posts: 11
Joined: Aug. 13, '04,
Status: offline
I used this rdate: http://freshmeat.net/projects/rdate/

_____________________________

Thanks,

Jim

(in reply to Rodney)
Post #: 8
RE: Where is inet_aton, inet_addr, etc. - Aug. 27, '04, 5:12:42 PM   
j1mw3b

 

Posts: 11
Joined: Aug. 13, '04,
Status: offline
Darn. I hit OK too fast. Wanted to ask where you got yours and do you find that the BSD tools port easier to Interix? If so, where are the BSD tools sources (guess I can search them out)?

I gotta compliment you on your responsiveness. I have read on some of the posts that you are the only one doing this and it's mostly volunteer work.

This has to be one of the lesser known products out there. It's great for those of us who only have a Win system at home but do development for Unix at work. I knew about the original Microsoft SFU, but it was pretty bad in it's early incarnation and I discarded it pretty quick.
This one is so much better.

_____________________________

Thanks,

Jim

(in reply to j1mw3b)
Post #: 9
RE: Where is inet_aton, inet_addr, etc. - Aug. 27, '04, 11:53:19 PM   
Rodney

 

Posts: 2916
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> I used this rdate: http://freshmeat.net/projects/rdate/

I'll take a quick look at it later to see what's up with it.

> Wanted to ask where you...

My rdate is the BSD version. It was original written by Christos Zoulas.
It's been used on the various BSD systems. Specifically it's the OpenBSD copy.
But corrections float among Open/Net/Free regularly.
Everything that I post as packages has the source available as well in:
ftp://ftp.interopsystems.com/src/*
The overall sources come from different places. But my tendency is to go
with a BSD/MIT licence first if possible. BSD tools can be found in source
form via any of the BSD web sites (CVS-web) or by purchasing one of their CD's.
(I regularly do purchase the OpenBSD CD for those wondering).

> I gotta compliment you on your responsiveness

thanks.
Mark is also around here regularly answering questions too.

> This one is so much better.

Oh, I'll well aware of that :-)
I was one of the very few that made Interix what it was before MS bought it
to replace the old SFU. About half the subsystem was my responsibility. S.
I know it quite well. That was back in 1999 we gave them the Firebrand project
which became Interix 3.0 in 2003. Don't ask why me why it took so long to release.
But for access to the source code, I could add so much more.
I'll stop here before I go on and get myself in trouble.

(in reply to j1mw3b)
Post #: 10
RE: Where is inet_aton, inet_addr, etc. - Aug. 28, '04, 9:35:52 AM   
j1mw3b

 

Posts: 11
Joined: Aug. 13, '04,
Status: offline
Actually, the OpenBSD rdate is far superior to the one I tried. I also looked yesterday at the FreeBSD version and the OpenBSD version and the FreeBSD only seems to do TIME, whereas OpenBSD does both TIME and SNTP.

So, I would only tinker with the one I have out of curiosity - had it occurred to me to use the OpenBSD version, I would have. I normally search for Linux sources, but now I've been looking at the BSD variants and am intrigued. Used to use the old Berkeley Unix years ago.

Gonna try to find a system at work to install one of the BSD systems on.

_____________________________

Thanks,

Jim

(in reply to Rodney)
Post #: 11
RE: Where is inet_aton, inet_addr, etc. - Aug. 31, '04, 10:12:30 AM   
Rodney

 

Posts: 2916
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
You might be interested in look at OpenNTPD as well then which was released
in just the past couple of weeks. http://www.openntpd.org/
It's a branch project of OpenBSD.

(in reply to j1mw3b)
Post #: 12
RE: Where is inet_aton, inet_addr, etc. - Oct. 18, '04, 9:25:16 PM   
jonsmi

 

Posts: 168
Joined: Aug. 12, '03,
From: Oslo, Norway
Status: offline
quote:

Here's the one from ftp package which compiles ftp.c (which has inet_ntoa, etc) with no error in the compile.
gcc -g -I/usr/local/include -L/usr/local/lib -D_ALL_SOURCE -Dunix -DAUTO_FETCH -c ftp.c

I followed your advice, and indeed, no errors, and an ftp.o. Now is the question,
how do I use it with ORBit2-2.11.2 (the goal is to get Galeon or Firefox under
Interix up and running)?

I still get this "linc-protocols.c: undefined reference to '___inet_addr'"
and other -- I do think related -- errors.

(in reply to j1mw3b)
Post #: 13
RE: Where is inet_aton, inet_addr, etc. - Oct. 19, '04, 12:14:22 AM   
Rodney

 

Posts: 2916
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
You have BIND 9.X installed then (9.2.3) ?
For the final link line do you include "-L /usr/local/lib -lbind" ?

(in reply to jonsmi)
Post #: 14
RE: Where is inet_aton, inet_addr, etc. - Oct. 19, '04, 8:34:55 AM   
jonsmi

 

Posts: 168
Joined: Aug. 12, '03,
From: Oslo, Norway
Status: offline
Department for stupid questions: Where should these incantations be placed -- on
the command-line or in the Makefile (and the exact syntax)?

Sorry: DOS --> DesqView --> OS/2 --> NT --> Linux (bash) --> Interix.
Programming: mostly Basic, early C, VB, Delphi, Java -- NOW I would like
to learn C/C++.

(in reply to Rodney)
Post #: 15
RE: Where is inet_aton, inet_addr, etc. - Oct. 19, '04, 9:18:04 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
probably in the command line when you invoke the gcc to compile the source

(in reply to jonsmi)
Post #: 16
RE: Where is inet_aton, inet_addr, etc. - Oct. 19, '04, 10:29:56 AM   
Rodney

 

Posts: 2916
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
...or in the "Makefile" if there is one.
If there is a Makefile then you'll likely see similar "-l" and "-L" settings.

(in reply to cortez_)
Post #: 17
RE: Where is inet_aton, inet_addr, etc. - Oct. 19, '04, 2:45:29 PM   
jonsmi

 

Posts: 168
Joined: Aug. 12, '03,
From: Oslo, Norway
Status: offline
Yes, usually I've been fiddling around with the Makefile, and most of the time
they were quite clear, but this one is heavy and confusing (for a bear of
small brains).

Would such an expression be possible: gcc "-L /usr/local/lib -lbind" make [all]?
Or are there any other parameters needed in addition (the quotation marks as
well)?

(For the time being it's still the classic Kernighan/Ritchie, when not hanging
around with computers -- so this is an excellent learning process).

BTW, equally important: Gnome 2.8 (stable) is out, a lot of the utilities and
libraries have been updated, for instance: glib 2.4.6 (2.5.9 still unstable).

Some of these port quite easily (glib, pango 1.6, atk 1.8) -- the struggle is with
gtk+-2.4.9 and ORBit2-2.12.0. Question: Should these libraries be ported static
(default) or in addition dynamic (I understood your changes in the config file)?

More general -- when in doubt (and it doesn't cause trouble as with Fox 1.2) --
should we always go for static and dynamic)? Being at it -- if you got time to
answer -- do dynamic unload when no longer needed as with Win32 .DLLs?

(in reply to Rodney)
Post #: 18
RE: Where is inet_aton, inet_addr, etc. - Oct. 19, '04, 3:15:04 PM   
Rodney

 

Posts: 2916
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
In the Makefile you don't want to put the "-L..." with the CC.
You want to find the LIBS line. If not that then the LN perhaps.

The usual is to port any libs static first. It's easier to find errors
when many of the libs link to some of their test programs. Also if there
are unresolved externals you find out now rather then when you go to run
a program and it complains. Once it looks fine I add the dynamic build
so that both static and dynamic are built. With some of the much larger
programs it becomes important to specify a load point for the shared libraries.
When doing OpenDX I ended up with a problem of the libraries (lots of them)
getting loaded and then their spaces overlapping. So I've been maintaining
a list of load points for the shared libraries for /Tools releases. The list
is in ftp://ftp.interopsystems.com/pub.

The shared libraries are shared libraries. They are loaded when a program starts.
When another program starts running at the same time then they will share the
clean pages of the library. When all progams that might reference the shared
library are not running, then it's removed from memory (reference count zero).
Now, if you use dlopen() and dlclose() programs can keep running and the DSO
will be unloaded because the reference count goes to zero.

(in reply to jonsmi)
Post #: 19
RE: Where is inet_aton, inet_addr, etc. - Oct. 20, '04, 7:19:37 AM   
jonsmi

 

Posts: 168
Joined: Aug. 12, '03,
From: Oslo, Norway
Status: offline
Rodney:
> You have BIND 9.X installed then (9.2.3) ?

As secondary DNS for AD-integrated DNS -- makes look-ups from Interix faster
(at least my impression)

> For the final link line do you include "-L /usr/local/lib -lbind"
quote:

ORIGINAL: Rodney
...or in the "Makefile" if there is one.
If there is a Makefile then you'll likely see similar "-l" and "-L" settings.

Yes, that worked. Extremely good to know!
Had to be done in the right Makefile in the right directory:
/build/ORBit2-2.12.0/linc2/src (there are quite some few Makefiles).

Then it's just to continue with new parse errors and undeclared variables
down the line ...

(in reply to Rodney)
Post #: 20
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> Where is inet_aton, inet_addr, etc. Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.063