Reputation: 127
The program is compiling and running in my friends system correctly but when I am trying to execute on my system it is showing the above error at the following line.
message_queue::size_type recvd_size;
I am also included the namespace
using namespace boost::interprocess;
I have installed the latest boost library, using sudo apt-get install libboost-all-dev
but again the compiler is showing error message as
error: ‘size_type’ is not a member of ‘boost::interprocess::message_queue’
Upvotes: 2
Views: 880
Reputation: 21520
Probably you need to specify where boost's headers are.
-I /<path_boost>/include
If it are in:
/usr/local/include
You need this link. This because in default PATH of linux isn't specified.
If you open a console and digit:
echo $PATH
you'll see what path is "visible".
If you want to modify it:
sudo nano /etc/environment
And add to PATH the string:
:/usr/local/include
UPDATE
Final step, logout+login or refresh /etc/environment, look here.
Upvotes: 2
Reputation: 4805
If you change it to std::size_t
it will work but I think the efficient way is to follow the
@Velthune's answer.
Upvotes: 1
Reputation: 33864
Your compiler is telling you exactly what is wrong. boost::interprocess::message_queue
as described here has no size_type
element. There are some functions there that return size_type
so you might be interested in doing something like this:
int maxMessages = myMessageQueue.get_max_msg();
Upvotes: 2