Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2004-10-06 05:01:47


> OK, awake again and looking into the beolow problem more...
> my program pulls a message off of a UDP datagram socket with
>
> int s = socket(AF_INET, SOCK_DGRAM, 0);
> int iVal;
> struct sockaddr_in oFromAddr;
> char msg[1024];
> int iMsgLen;
> socklen_t iFromLen;
>
> oMyAddr.sin_family = AF_INET;
> oMyAddr.sin_addr.s_addr = htonl(INADDR_ANY);
> oMyAddr.sin_port = htons(5060);
> iVal = bind(s, (struct sockaddr *) &oMyAddr, sizeof (oMyAddr));
>
> int iVal = recvfrom(s, (void *)&msg, iMsgLen, 0, (struct sockaddr *)
> &oFromAddr, &iFromLen);
>
> When I link to libboost_regex and i get past this last line, the msg
> buffer is still filled with null characters and the return value of
> recvfrom is 0-it didnt get anything off of the socket. All I am doing is
> linking the lib, im not calling on headers or the lib in any way. Taking
> -lboost_regex out fo the linker flags fixes that issue. Also, when i
> create char msg[1024], the contents of msg are trash, not repeating null
> characters(as they are when boost_regex is linked to). What is boost
> doing, im pretty new to it..
> thanks, dave

It shouldn't be doing anything that would influence the contents of your own
code in the way you describe, the only thing I can think of is that the
version you are using (it's a binary right?) was built with a different
compiler version, or settings, from the ones you are using. What happens if
you rebuild Boost.Regex from source and link to that?

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net