boost install with gentoo issue?
Well, more likely my mistake, ive been up awhile.. I installed the boost libs onto my gentoo machine with emerge. I then added -lboost_regex to my linker flags..thats it. When I run my app, it hangs, I think when waiting on pulling data of off a UDP socket. Though I cant tell, I'm about to crash and its been one of those days. But I do know everything is back to normal when I take -lboost_regex out of the flags again. I know I'm awfully vague due to lazy/tiredness, but does this ring a bell with anyone? I've installed boost the traditional way (bjam) on other linux distros before without any issue, but ive never tried emerge before. I dont know if this has something to do with it, or i am somehow missing something really obvious.. Thanks for bearing with me, Dave
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
Well, more likely my mistake, ive been up awhile.. I installed the boost libs onto my gentoo machine with emerge.
I then added -lboost_regex to my linker flags..thats it. When I run my app, it hangs, I think when waiting on pulling data of off a UDP socket. Though I cant tell, I'm about to crash and its been one of those days. But I do know everything is back to normal when I take -lboost_regex out of the flags again.
I know I'm awfully vague due to lazy/tiredness, but does this ring a bell with anyone? I've installed boost the traditional way (bjam) on other linux distros before without any issue, but ive never tried emerge before. I dont know if this has something to do with it, or i am somehow missing something really obvious..
Thanks for bearing with me, Dave _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Tue, 5 Oct 2004 12:00:37 -0000 (UTC), dave@superelite.net
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);
If this is the actual code, iMsgLen is being used uninitialized.
Also, you're passing the address of msg, which is incorrect. Here's
working code:
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include
Hi all, I'm trying to use the serialization library to serialize some classes. The least intrusive case is a headache because some of them don't even give me constructors I can access. The best would be to declare the serialize function as a friend of my class. For some reason it doesn't work. This is what I do in the class definition (inside namespace evt): friend class boost::serialization::access; template<class Archive> friend void ::boost::serialization::serialize( Archive & ar, Event & t, const unsigned int file_version); and this is what I do when I define the function: template<class Archive> void serialize( Archive & ar, evt::Event & t, const unsigned int file_version) { ar & BOOST_SERIALIZATION_NVP(t.fSEvent); }; Then I include both headers where I need to use them and allways get something like this: /home/JGonzalez/private/serialization/Event.h:24: `float evt::Event::fSEvent' is private /home/JGonzalez/private/serialization/SEventStreamers.h:32: within this context I don't know what I'm missing! I'm including both files. Does any one have an idea that could help me? thanks. Javier _______________________________ Do you Yahoo!? Express yourself with Y! Messenger! Free. Download now. http://messenger.yahoo.com
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.
participants (4)
-
Caleb Epstein
-
dave@superelite.net
-
Javier Gonzalez
-
John Maddock