Thread: [Plib-users] need help compiling plib
Brought to you by:
sjbaker
|
From: Mathew K. <ma...@ne...> - 2002-04-21 17:12:32
|
Hello all, I download the most recent stable version of plib and tried to compiled it win mandrake 8.1. I received the following error: make[2]: Entering directory `/usr/src/plib-1.4.2/src/net' c++ -DPACKAGE=\"plib\" -DVERSION=\"1.4.2\" -DHAVE_LIBDL=1 -DHAVE_LIBGL=1 -DH AVE_LIBGLU=1 -DHAVE_LIBGLUT=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 -DLINUX_JOY STICK_IS_PRESENT=1 -DGLUT_IS_PRESENT=1 -I. -I. -I../../src/util -I/usr/lo cal/include -g -O2 -O6 -Wall -c netSocket.cxx netSocket.cxx: In method `int netSocket::accept (netAddress *)': netSocket.cxx:218: cannot convert `int *' to `socklen_t *' for argument `3' to `accept (int, sockaddr *, socklen_t *)' netSocket.cxx: In method `int netSocket::recvfrom (void *, int, int, netAddress *)': netSocket.cxx:256: cannot convert `int *' to `socklen_t *' for argument `6' to `recvfrom (int, void *, unsigned int, int, sockaddr *, socklen_t *)' make[2]: *** [netSocket.o] Error 1 make[2]: Leaving directory `/usr/src/plib-1.4.2/src/net' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/plib-1.4.2/src' make: *** [all-recursive] Error 1 Where shoud soklen_t be defined? I assuming I just need to include an another .h file, just am not sure which one. |
|
From: Sebastian U. <ud...@ha...> - 2002-04-21 17:38:19
|
On Sun, 21 Apr 2002, ma...@ne... (Mathew Kohel) wrote: > Date: Sun, 21 Apr 2002 12:22:14 -0500 > To: <pli...@li...> > From: ma...@ne... (Mathew Kohel) > Subject: [Plib-users] need help compiling plib > > Hello all, > > I download the most recent stable version of plib and tried to compiled > it win mandrake 8.1. > > I received the following error: > > make[2]: Entering directory `/usr/src/plib-1.4.2/src/net' > c++ -DPACKAGE=\"plib\" -DVERSION=\"1.4.2\" -DHAVE_LIBDL=1 -DHAVE_LIBGL=1 > -DH > AVE_LIBGLU=1 -DHAVE_LIBGLUT=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 > -DLINUX_JOY > STICK_IS_PRESENT=1 -DGLUT_IS_PRESENT=1 -I. -I. -I../../src/util > -I/usr/lo > cal/include > -g -O2 -O6 -Wall -c netSocket.cxx > netSocket.cxx: In method `int netSocket::accept (netAddress *)': > netSocket.cxx:218: cannot convert `int *' to `socklen_t *' for argument > `3' to `accept (int, sockaddr *, socklen_t *)' > netSocket.cxx: In method `int netSocket::recvfrom (void *, int, int, > netAddress *)': > netSocket.cxx:256: cannot convert `int *' to `socklen_t *' for argument > `6' to `recvfrom (int, void *, unsigned int, int, sockaddr *, socklen_t > *)' [...] > Where shoud soklen_t be defined? I assuming I just need to include an > another .h file, just am not sure which one. The source file should include "sys/types.h", but it doesn't. (To the original author: typedef'ing "socklen_t" to be "int" is not a solution. Passing a pointer to your home-made type to a library function is dangerous, since nobody gurantees that the "socklen_t" of the C library and your definition have the same size. "man recv" explicitly says that both "sys/socket.h" and "sys/types.h must be included. I guess including "sys/types.h" will fix the problem for you. Please try it and report if it did so that we can fix this bug in CVS. - Sebastian |
|
From: Steve B. <sjb...@ai...> - 2002-04-21 23:53:10
|
Sebastian Ude wrote: > > On Sun, 21 Apr 2002, ma...@ne... (Mathew Kohel) wrote: > > Date: Sun, 21 Apr 2002 12:22:14 -0500 > > To: <pli...@li...> > > From: ma...@ne... (Mathew Kohel) > > Subject: [Plib-users] need help compiling plib > > > > Hello all, > > > > I download the most recent stable version of plib and tried to compiled > > it win mandrake 8.1. > > > > I received the following error: > > > > make[2]: Entering directory `/usr/src/plib-1.4.2/src/net' > > c++ -DPACKAGE=\"plib\" -DVERSION=\"1.4.2\" -DHAVE_LIBDL=1 -DHAVE_LIBGL=1 > > -DH > > AVE_LIBGLU=1 -DHAVE_LIBGLUT=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 > > -DLINUX_JOY > > STICK_IS_PRESENT=1 -DGLUT_IS_PRESENT=1 -I. -I. -I../../src/util > > -I/usr/lo > > cal/include > > -g -O2 -O6 -Wall -c netSocket.cxx > > netSocket.cxx: In method `int netSocket::accept (netAddress *)': > > netSocket.cxx:218: cannot convert `int *' to `socklen_t *' for argument > > `3' to `accept (int, sockaddr *, socklen_t *)' > > netSocket.cxx: In method `int netSocket::recvfrom (void *, int, int, > > netAddress *)': > > netSocket.cxx:256: cannot convert `int *' to `socklen_t *' for argument > > `6' to `recvfrom (int, void *, unsigned int, int, sockaddr *, socklen_t > > *)' > > [...] > > > Where shoud soklen_t be defined? I assuming I just need to include an > > another .h file, just am not sure which one. > > The source file should include "sys/types.h", but it doesn't. (To the > original author: typedef'ing "socklen_t" to be "int" is not a solution. There are problems with some OS's (I think IRIX is one of them) with those things. I don't think older Unixen define socklen_t - so you have to use an 'int'. ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |
|
From: Sebastian U. <ud...@ha...> - 2002-04-22 00:14:04
|
On Sun, 21 Apr 2002, sjb...@ai... (Steve Baker) wrote: > Date: Sun, 21 Apr 2002 18:48:23 -0500 > To: ud...@ha... > From: sjb...@ai... (Steve Baker) > CC: pli...@li... > Reply-To: sjb...@ai... > Subject: Re: [Plib-users] need help compiling plib [...] > > The source file should include "sys/types.h", but it doesn't. (To the > > original author: typedef'ing "socklen_t" to be "int" is not a solution. > > There are problems with some OS's (I think IRIX is one of them) with > those things. I don't think older Unixen define socklen_t - so you have > to use an 'int'. Okay. The problem is, however, that by not including "sys/types.h", the current code even typedef's "socklen_t" to be "int" on machines that *do* define socklen_t, which can be fatal when it comes to pointers to those types. As the manuals of standard-conforming UNIX systems do, I really suggest including "sys/types.h" in addition to "sys/socket.h". It is a standard header file - does IRIX miss it, too ? If yes, just add a check for it in configure.in. - Sebastian |
|
From: Steve B. <sjb...@ai...> - 2002-04-22 02:35:19
|
Sebastian Ude wrote: > > On Sun, 21 Apr 2002, sjb...@ai... (Steve Baker) wrote: > > Date: Sun, 21 Apr 2002 18:48:23 -0500 > > To: ud...@ha... > > From: sjb...@ai... (Steve Baker) > > CC: pli...@li... > > Reply-To: sjb...@ai... > > Subject: Re: [Plib-users] need help compiling plib > > [...] > > > > The source file should include "sys/types.h", but it doesn't. (To the > > > original author: typedef'ing "socklen_t" to be "int" is not a solution. > > > > There are problems with some OS's (I think IRIX is one of them) with > > those things. I don't think older Unixen define socklen_t - so you have > > to use an 'int'. > > Okay. The problem is, however, that by not including "sys/types.h", the > current code even typedef's "socklen_t" to be "int" on machines that *do* > define socklen_t, which can be fatal when it comes to pointers to those > types. > > As the manuals of standard-conforming UNIX systems do, I really suggest > including "sys/types.h" in addition to "sys/socket.h". It is a standard > header file - does IRIX miss it, too ? If yes, just add a check for it in > configure.in. sys/types.h exists - but the socklen_t type does not. Clearly we should be including that header - but we may need conditional compilation to use socklen_t only if it's defined and fall back on an 'int' instead. To be honest though, it's hard to imagine a socket system whose internal structure was more than 2^32 bytes long! ----------------------------- Steve Baker ------------------------------- Mail : <sjb...@ai...> WorkMail: <sj...@li...> URLs : http://www.sjbaker.org http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net http://lodestone.sf.net |