Thread: [Plib-users] Installing plib-1.4.1
Brought to you by:
sjbaker
|
From: Lars T. <to...@cs...> - 2001-07-11 19:49:27
|
Hallo, I've got some problems installing plib version 1.4.1. The compiler says... c++ -DPACKAGE=\"plib\" -DVERSION=\"1.4.1\" -DHAVE_LIBDL=1 -DHAVE_LIBGL=1 -DHAVE_LIBGLU=1 -DHAVE_LIBGLUT=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 -DLINUX_JOYSTICK_IS_PRESENT=1 -DGLUT_IS_PRESENT=1 -I. -I. -I../../src/util -I/usr/local/include -g -O2 -O6 -Wall -c netSocket.cxx netSocket.cxx: In method `int netSocket::accept(netAddress *)': netSocket.cxx:217: passing `int *' as argument 3 of `accept(int, sockaddr *, socklen_t *)' changes signedness netSocket.cxx: In method `int netSocket::recvfrom(void *, int, int, netAddress *)': netSocket.cxx:254: passing `int *' as argument 6 of `recvfrom(int, void *, unsigned int, int, sockaddr *, socklen_t *)' changes signedness make: *** [netSocket.o] Error 1 This happens only in version 1.4.0 and 1.4.1. Plib-1.2.0 compiles fine (but I need 1.4.1 :) for FlightGear-0.7.8; Thanks to booth teams - great work) I have gcc-2.95.2 and a normal SuSE 7.0. Any guesses what goes wrong ? Thanks in advance, bye lars. |
|
From: Sam S. <sa...@sp...> - 2001-07-11 20:05:01
|
----- Original Message ----- From: "Lars Tornow" <to...@cs...> To: <pli...@li...> Sent: Wednesday, July 11, 2001 8:47 PM Subject: [Plib-users] Installing plib-1.4.1 > Hallo, > > I've got some problems installing plib version 1.4.1. The compiler says... > > c++ -DPACKAGE=\"plib\" -DVERSION=\"1.4.1\" -DHAVE_LIBDL=1 -DHAVE_LIBGL=1 > -DHAVE_LIBGLU=1 -DHAVE_LIBGLUT=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1 > -DLINUX_JOYSTICK_IS_PRESENT=1 -DGLUT_IS_PRESENT=1 -I. -I. > -I../../src/util -I/usr/local/include -g -O2 -O6 -Wall -c netSocket.cxx > netSocket.cxx: In method `int netSocket::accept(netAddress *)': > netSocket.cxx:217: passing `int *' as argument 3 of `accept(int, sockaddr > *, socklen_t *)' changes signedness > netSocket.cxx: In method `int netSocket::recvfrom(void *, int, int, > netAddress *)': > netSocket.cxx:254: passing `int *' as argument 6 of `recvfrom(int, void *, > unsigned int, int, sockaddr *, socklen_t *)' changes signedness > make: *** [netSocket.o] Error 1 > > This happens only in version 1.4.0 and 1.4.1. Plib-1.2.0 compiles fine > (but I need 1.4.1 :) for FlightGear-0.7.8; Thanks to booth teams - great > work) I have gcc-2.95.2 and a normal SuSE 7.0. > > Any guesses what goes wrong ? Yes - on some platforms socklen_t is an int, and on others an unsigned int. It appears in these cases 'int' has been written rather than socklen_t. So this code will work on some setups, but complain on others. I don't have time right now to fix this myself, but I've sent this mail to the developers list so hopefully one of them can pick this up. Sam |
|
From: Steve B. <sjb...@ai...> - 2001-07-11 21:59:18
|
Sam Stickland wrote: > Yes - on some platforms socklen_t is an int, and on others an unsigned int. It appears in these cases 'int' has been written rather > than socklen_t. So this code will work on some setups, but complain on others. Yes - but on yet others, socklen_t is not defined. There is no way to avoid an ifdef here. :-( ----------------------------- Steve Baker ------------------------------- HomeMail : <sjb...@ai...> WorkMail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sf.net http://tuxaqfh.sf.net http://tuxkart.sf.net http://agtoys.sf.net http://prettypoly.sf.net http://freeglut.sf.net http://toobular.sf.net |
|
From: Lars T. <to...@cs...> - 2001-07-11 22:29:45
|
On Wed, 11 Jul 2001, Sam Stickland wrote:
>
> ----- Original Message -----
> From: "Lars Tornow" <to...@cs...>
> To: <pli...@li...>
> Sent: Wednesday, July 11, 2001 8:47 PM
> Subject: [Plib-users] Installing plib-1.4.1
>
>
> > Hallo,
> >
> > I've got some problems installing plib version 1.4.1. The compiler says...
> >
> > c++ -DPACKAGE=\"plib\" -DVERSION=\"1.4.1\" -DHAVE_LIBDL=1 -DHAVE_LIBGL=1
> > -DHAVE_LIBGLU=1 -DHAVE_LIBGLUT=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1
> > -DLINUX_JOYSTICK_IS_PRESENT=1 -DGLUT_IS_PRESENT=1 -I. -I.
> > -I../../src/util -I/usr/local/include -g -O2 -O6 -Wall -c netSocket.cxx
> > netSocket.cxx: In method `int netSocket::accept(netAddress *)':
> > netSocket.cxx:217: passing `int *' as argument 3 of `accept(int, sockaddr
> > *, socklen_t *)' changes signedness
> > netSocket.cxx: In method `int netSocket::recvfrom(void *, int, int,
> > netAddress *)':
> > netSocket.cxx:254: passing `int *' as argument 6 of `recvfrom(int, void *,
> > unsigned int, int, sockaddr *, socklen_t *)' changes signedness
> > make: *** [netSocket.o] Error 1
> >
> > This happens only in version 1.4.0 and 1.4.1. Plib-1.2.0 compiles fine
> > (but I need 1.4.1 :) for FlightGear-0.7.8; Thanks to booth teams - great
> > work) I have gcc-2.95.2 and a normal SuSE 7.0.
> >
> > Any guesses what goes wrong ?
>
> Yes - on some platforms socklen_t is an int, and on others an unsigned int. It appears in these cases 'int' has been written rather
> than socklen_t. So this code will work on some setups, but complain on others.
>
> I don't have time right now to fix this myself, but I've sent this mail to the developers list so hopefully one of them can pick
> this up.
>
> Sam
>
Hello, thanks for the quick answer. Looks like I have the wrong
environment :) Maybe I find some time to look at the problem myself, now
that I know what the problem is.
bye lars.
---------------------------------------------------------
Real Programmers don't document -
If it was hard to write, it should be hard to understand.
---------------------------------------------------------
|
|
From: Lars T. <to...@cs...> - 2001-07-12 18:54:41
|
On Wed, 11 Jul 2001, Sam Stickland wrote:
>
> ----- Original Message -----
> From: "Lars Tornow" <to...@cs...>
> To: <pli...@li...>
> Sent: Wednesday, July 11, 2001 8:47 PM
> Subject: [Plib-users] Installing plib-1.4.1
>
>
> > Hallo,
> >
> > I've got some problems installing plib version 1.4.1. The compiler says...
> >
> > c++ -DPACKAGE=\"plib\" -DVERSION=\"1.4.1\" -DHAVE_LIBDL=1 -DHAVE_LIBGL=1
> > -DHAVE_LIBGLU=1 -DHAVE_LIBGLUT=1 -DHAVE_GL_GL_H=1 -DHAVE_GL_GLU_H=1
> > -DLINUX_JOYSTICK_IS_PRESENT=1 -DGLUT_IS_PRESENT=1 -I. -I.
> > -I../../src/util -I/usr/local/include -g -O2 -O6 -Wall -c netSocket.cxx
> > netSocket.cxx: In method `int netSocket::accept(netAddress *)':
> > netSocket.cxx:217: passing `int *' as argument 3 of `accept(int, sockaddr
> > *, socklen_t *)' changes signedness
> > netSocket.cxx: In method `int netSocket::recvfrom(void *, int, int,
> > netAddress *)':
> > netSocket.cxx:254: passing `int *' as argument 6 of `recvfrom(int, void *,
> > unsigned int, int, sockaddr *, socklen_t *)' changes signedness
> > make: *** [netSocket.o] Error 1
> >
> > This happens only in version 1.4.0 and 1.4.1. Plib-1.2.0 compiles fine
> > (but I need 1.4.1 :) for FlightGear-0.7.8; Thanks to booth teams - great
> > work) I have gcc-2.95.2 and a normal SuSE 7.0.
> >
> > Any guesses what goes wrong ?
>
> Yes - on some platforms socklen_t is an int, and on others an unsigned int. It appears in these cases 'int' has been written rather
> than socklen_t. So this code will work on some setups, but complain on others.
>
> I don't have time right now to fix this myself, but I've sent this mail to the developers list so hopefully one of them can pick
> this up.
>
> Sam
>
hello,
I've found a quick solution for this:
an expicit cast to unsigned int
int
netSocket::accept ( netAddress* addr )
{
assert ( handle != -1 ) ;
socklen_t addr_len = sizeof(netAddress) ;
return ::accept(handle,(sockaddr*)addr,&(unsigned int)addr_len);
}
I know it doesn't solve the problem on the root, but ...
for me it works for now :)
bye lars.
|