From: UnixOS2 Archive To: "UnixOS2 Archive" Date: Wed, 17 Apr 2002 04:23:44 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 196 ************************************************** Tuesday 16 April 2002 Number 196 ************************************************** Subjects for today 1 Re: compiling c++ program under gcc 3.0.3 : Arnstein.Prytz at jcu.edu.au 2 Re: CDDB Server : csaba.raduly at sophos.com 3 Re: CDDB Server : John Poltorak 4 Re: CDDB Server : csaba.raduly at sophos.com 5 Re: CDDB Server : John Poltorak 6 Re: CDDB Server : csaba.raduly at sophos.com 7 Re: CDDB Server : Thomas Hoffmann 8 Re: CDDB Server : Dave and Natalie" 9 unixos2.com : Ted Sikora 10 Re: CDDB Server : Holger Veit **= Email 1 ==========================** Date: Wed, 17 Apr 2002 09:03:12 -0400 From: Arnstein.Prytz at jcu.edu.au Subject: Re: compiling c++ program under gcc 3.0.3 Thank you to those who responded to my problem. Andrew pinpointed what to do. > Okay, so I assume you have installed the gcc-os2-3.0.3-beta-gpp.zip file, thus > you have the /emx/lib/gcc-lib/i386-pc-os2_emx/3.0.3/ subdirectory, and a > "cc1plus.exe", "st/stdcxx.a" and "mt/stdcxx.a" inside it. > Now go there and type "make". Everything should go fine. > Now you should remove from all your C_INCLUDE_PATH, CPLUS_INCLUDE_PATH and > LIBRARY_PATH variables any path components which point to any EMX directories. I had done all the things mentioned in the installation file, as was evidenced by all sorts of .lib files appearing with the new (yesterday's) date. I found, however, that I have to keep LIBRARY_PATH=e:/usr/local/emx/lib otherwise that particular program was unable to find crt0.o. Any ideas what that is about? I cannot imagine that this directory should not be included because a whole bunch of .lib files were updated there as a result of the make operation. Regards, Arnstein ------------------------------------------------------------------ Arnstein Prytz Arnstein.Prytz at jcu.edu.au School of Maths and Physics ph: 61-7-47815183 James Cook University fax: 61-7-47815880 Townsville, Queensland 4811, Australia ------------------------------------------------------------------ **= Email 2 ==========================** Date: Wed, 17 Apr 2002 10:20:29 +0100 From: csaba.raduly at sophos.com Subject: Re: CDDB Server On 17/04/2002 05:16:55 Dave and Natalie wrote: [snip compilation of CDDB server] >>> >>>gcc -O -c inet.c >>>inet.c: In function `get_rmt_hostname': >>>inet.c:132: `socklen_t' undeclared (first use in this function) > >This function isn't implemented in emx, maybe in posix/2? socklen_t, as its name suggests, is a typedef, not a function. Recursively `grep socklen_t *.h` in /emx/include to see which header defines socklen_t. Apparently, none. That's odd. Usually, these kind of type definitions *are* available on EMX, in a header in include/arpa, include/af, include/net, etc. People writing software on Linux seem to only include unistd.h, which either contains everything :-) or includes lots of other headers. The EMX version of unistd.h doesn't. (Another typical example is the need to explicitly include before other headers, most notably ). On Linux, typedef unsigned int __socklen_t; typedef __socklen_t socklen_t; You can try adding -Dsocklen_t=unsigned to CFLAGS. -- Csaba Ráduly, Software Engineer Sophos Anti-Virus email: csaba.raduly at sophos.com http://www.sophos.com US Support: +1 888 SOPHOS 9 UK Support: +44 1235 559933 **= Email 3 ==========================** Date: Wed, 17 Apr 2002 11:47:20 +0100 From: John Poltorak Subject: Re: CDDB Server On Wed, Apr 17, 2002 at 10:20:29AM +0100, csaba.raduly at sophos.com wrote: > > >This function isn't implemented in emx, maybe in posix/2? > > socklen_t, as its name suggests, is a typedef, not a function. > Recursively `grep socklen_t *.h` in /emx/include to see > which header defines socklen_t. Apparently, none. > > That's odd. Usually, these kind of type definitions > *are* available on EMX, in a header in include/arpa, include/af, > include/net, etc. People writing software on Linux seem to > only include unistd.h, which either contains everything :-) > or includes lots of other headers. The EMX version of > unistd.h doesn't. (Another typical example is the need > to explicitly include before other headers, > most notably ). > > On Linux, > > typedef unsigned int __socklen_t; > typedef __socklen_t socklen_t; > > You can try adding -Dsocklen_t=unsigned to CFLAGS. It gets further now, but I get these errors:- cddbd.o: Undefined symbol _endgrent referenced from text segment cddbd.o: Undefined symbol _gethostname referenced from text segment cddbd.o: Undefined symbol _link referenced from text segment cddbd.o: Undefined symbol _srand48 referenced from text segment cddbd.o: Undefined symbol _lrand48 referenced from text segment cddbd.o: Undefined symbol _chown referenced from text segment db.o: Undefined symbol _chown referenced from text segment inet.o: Undefined symbol _inet_addr referenced from text segment inet.o: Undefined symbol _gethostbyaddr referenced from text segment inet.o: Undefined symbol _getpeername referenced from text segment inet.o: Undefined symbol _gethostbyname referenced from text segment inet.o: Undefined symbol _gethostbyaddr referenced from text segment inet.o: Undefined symbol _inet_ntoa referenced from text segment inet.o: Undefined symbol _gethostbyname referenced from text segment inet.o: Undefined symbol _inet_ntoa referenced from text segment inet.o: Undefined symbol _inet_addr referenced from text segment inet.o: Undefined symbol _gethostbyaddr referenced from text segment inet.o: Undefined symbol _gethostbyname referenced from text segment inet.o: Undefined symbol _inet_ntoa referenced from text segment inet.o: Undefined symbol _getnetbyname referenced from text segment inet.o: Undefined symbol __swapl referenced from text segment inet.o: Undefined symbol _inet_ntoa referenced from text segment inet.o: Undefined symbol _inet_ntoa referenced from text segment inet.o: Undefined symbol _socket referenced from text segment inet.o: Undefined symbol _setsockopt referenced from text segment inet.o: Undefined symbol __swapl referenced from text segment inet.o: Undefined symbol _bind referenced from text segment inet.o: Undefined symbol _listen referenced from text segment inet.o: Undefined symbol _setsid referenced from text segment inet.o: Undefined symbol _accept referenced from text segment inet.o: Undefined symbol _gethostbyname referenced from text segment inet.o: Undefined symbol _inet_addr referenced from text segment inet.o: Undefined symbol _socket referenced from text segment inet.o: Undefined symbol _connect referenced from text segment inet.o: Undefined symbol _shutdown referenced from text segment inet.o: Undefined symbol _getservbyname referenced from text segment inet.o: Undefined symbol __swaps referenced from text segment xmit.o: Undefined symbol __swaps referenced from text segment make: *** [cddbd] Error 1 Is there some libs missing? -- John **= Email 4 ==========================** Date: Wed, 17 Apr 2002 14:03:06 +0100 From: csaba.raduly at sophos.com Subject: Re: CDDB Server On 17/04/2002 11:47:20 John Poltorak wrote: >On Wed, Apr 17, 2002 at 10:20:29AM +0100, csaba.raduly at sophos.com wrote: >> >> >This function isn't implemented in EMX, maybe in posix/2? >> >> socklen_t, as its name suggests, is a typedef, not a function. >> Recursively `grep socklen_t *.h` in /emx/include to see >> which header defines socklen_t. Apparently, none. >> >> That's odd. Usually, these kind of type definitions >> *are* available on EMX, in a header in include/arpa, include/af, >> include/net, etc. People writing software on Linux seem to >> only include unistd.h, which either contains everything :-) >> or includes lots of other headers. The EMX version of >> unistd.h doesn't. (Another typical example is the need >> to explicitly include before other headers, >> most notably ). >> >> On Linux, >> >> typedef unsigned int __socklen_t; >> typedef __socklen_t socklen_t; >> >> You can try adding -Dsocklen_t=unsigned to CFLAGS. > >It gets further now, but I get these errors:- > >cddbd.o: Undefined symbol _endgrent referenced from text segment This deals with stuff in /usr/groups (i.e. the groups database). There's no such thing in EMX (or OS/2 for that matter). You'll need to #ifdef it out. >cddbd.o: Undefined symbol _srand48 referenced from text segment >cddbd.o: Undefined symbol _lrand48 referenced from text segment These are "better" random number functions. They live in -lbsd >cddbd.o: Undefined symbol _chown referenced from text segment >db.o: Undefined symbol _chown referenced from text segment chown() is not be implemented. You'll need to #ifdef it out. [snip lots of undefined symbols] You need to add -lsocket too (as suggested, preemptively, by "Dave and Natalie"). -- Csaba Ráduly, Software Engineer Sophos Anti-Virus email: csaba.raduly at sophos.com http://www.sophos.com US Support: +1 888 SOPHOS 9 UK Support: +44 1235 559933 **= Email 5 ==========================** Date: Wed, 17 Apr 2002 14:41:39 +0100 From: John Poltorak Subject: Re: CDDB Server On Wed, Apr 17, 2002 at 02:03:06PM +0100, csaba.raduly at sophos.com wrote: > > On 17/04/2002 11:47:20 John Poltorak wrote: > > >On Wed, Apr 17, 2002 at 10:20:29AM +0100, csaba.raduly at sophos.com wrote: > >> > >> You can try adding -Dsocklen_t=unsigned to CFLAGS. > > > >It gets further now, but I get these errors:- > > > >cddbd.o: Undefined symbol _endgrent referenced from text segment > > This deals with stuff in /usr/groups (i.e. the groups database). > There's no such thing in EMX (or OS/2 for that matter). > You'll need to #ifdef it out. Well I'm whittling them down slowly but surely. This is what is left:- cddbd.o: Undefined symbol _link referenced from text segment cddbd.o: Undefined symbol _srand48 referenced from text segment cddbd.o: Undefined symbol _lrand48 referenced from text segment inet.o: Undefined symbol _setsid referenced from text segment make: *** [cddbd] Error 1 > >cddbd.o: Undefined symbol _srand48 referenced from text segment > >cddbd.o: Undefined symbol _lrand48 referenced from text segment > > These are "better" random number functions. They live in -lbsd I added -lbsd, but it didn't find these functions. How do I check for their presence? Or does libbsd use different names? -- John **= Email 6 ==========================** Date: Wed, 17 Apr 2002 16:48:52 +0100 From: csaba.raduly at sophos.com Subject: Re: CDDB Server On 17/04/2002 14:41:39 owner-os2-unix wrote: >On Wed, Apr 17, 2002 at 02:03:06PM +0100, csaba.raduly at sophos.com wrote: >> >> On 17/04/2002 11:47:20 John Poltorak wrote: >> >> >On Wed, Apr 17, 2002 at 10:20:29AM +0100, csaba.raduly at sophos.com wrote: >> >> >> >> You can try adding -Dsocklen_t=unsigned to CFLAGS. >> > >> >It gets further now, but I get these errors:- >> > >> >cddbd.o: Undefined symbol _endgrent referenced from text segment >> >> This deals with stuff in /usr/groups (i.e. the groups database). >> There's no such thing in EMX (or OS/2 for that matter). >> You'll need to #ifdef it out. > > >Well I'm whittling them down slowly but surely. > >This is what is left:- > >cddbd.o: Undefined symbol _link referenced from text segment It's trying to create a symlink. Implementing symlinks is left as an exercise to Holger Veit :-) >cddbd.o: Undefined symbol _srand48 referenced from text segment >cddbd.o: Undefined symbol _lrand48 referenced from text segment My mistake, see below. >inet.o: Undefined symbol _setsid referenced from text segment That's odd. setsid() seems to be present in c.a (nm /emx/lib/st/c.a | grep setsid ) Try adding -lc to the link step. >make: *** [cddbd] Error 1 > > >> >cddbd.o: Undefined symbol _srand48 referenced from text segment >> >cddbd.o: Undefined symbol _lrand48 referenced from text segment >> >> These are "better" random number functions. They live in -lbsd > >I added -lbsd, but it didn't find these functions. Duh. The better random number functions in -lbsd are called random() and srandom(), respectively. You need to add -Drand48=random -Dsrand48=srandom to CFLAGS -- Csaba Ráduly, Software Engineer Sophos Anti-Virus email: csaba.raduly at sophos.com http://www.sophos.com US Support: +1 888 SOPHOS 9 UK Support: +44 1235 559933 **= Email 7 ==========================** Date: Wed, 17 Apr 2002 20:32:36 +0100 From: Thomas Hoffmann Subject: Re: CDDB Server Dave and Natalie schrieb: > >>gcc -O -c inet.c > >>inet.c: In function `get_rmt_hostname': > >>inet.c:132: `socklen_t' undeclared (first use in this function) > > This function isn't implemented in emx, maybe in posix/2? > Dave Yes: G:\emx\include>grep -r "socklen_t" * i386/types.h:typedef int32_t socklen_t; /* length type for network syscalls */ posix2 has some of the other stuff, too: G:\emx\include>grep -r "rand48" * .... stdlib.h:extern void srand48(long); stdlib.h:extern double drand48(void); I am not that glad to see these long threads ending up with #ifdef excesses starting again ... Thomas. -- Thomas Hoffmann Telephone: 49-351-4598831 thoffman at zappa.sax.de Dresden, Germany ..sig under construction ... **= Email 8 ==========================** Date: Wed, 17 Apr 2002 22:13:56 -0800 From: "Dave and Natalie" Subject: Re: CDDB Server On Wed, 17 Apr 2002 23:17:51 +0200, Holger Veit wrote: > >This is a typedef in some sys header file. It is quite standard. >If you don't have it, simply add a > typedef int socklen_t; >somewhere. Thanx for pointing this out, I obviously got confused reading includes from my linux partition Dave **= Email 9 ==========================** Date: Wed, 17 Apr 2002 22:17:06 -0400 From: Ted Sikora Subject: unixos2.com I just upped the limit on downloads.. again. Were really getting clobbered. I'll probably up the bandwidth at month's end again. Enough to add another 10 users. In the meantime you can use the mirror at http://powerusersbbs.net It will be a complete mirror this weekend I hope. -- Ted Sikora tsikora at unixos2.com http://unixos2.com **= Email 10 ==========================** Date: Wed, 17 Apr 2002 23:17:51 +0200 From: Holger Veit Subject: Re: CDDB Server On Tue, Apr 16, 2002 at 08:16:55PM -0800, Dave and Natalie wrote: > On Tue, 16 Apr 2002 19:28:33 -0800, Dave and Natalie wrote: > > >On Tue, 16 Apr 2002 19:31:38 +0100, John Poltorak wrote: > > > >> > >>Has anyone tried building a CDDB server? > >> > >>It's available here:- > >> > >>ftp://ftp.freedb.org/pub/freedb/cddbd-1.4.tar.gz > >> > >> > >>I tried but got a number of compile errors:- > >> > >>gcc -O -c inet.c > >>inet.c: In function `get_rmt_hostname': > >>inet.c:132: `socklen_t' undeclared (first use in this function) > > This function isn't implemented in emx, maybe in posix/2? This is a typedef in some sys header file. It is quite standard. If you don't have it, simply add a typedef int socklen_t; somewhere. Holger -- Please update your tables to my new e-mail address: holger.veit$ais.fhg.de (replace the '$' with ' at ' -- spam-protection)