2

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’

2
  • Care to share the actual code that causes this error? Commented Jul 31, 2014 at 6:06
  • "c,c++" is not an entity. Boost is a C++ library. If you don't know which language you are using, how are you going to use it? Commented Jul 31, 2014 at 6:08

3 Answers 3

2

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();
Sign up to request clarification or add additional context in comments.

1 Comment

yes but it is working fine on other computer so the size_type is defined in the namespace of message_queue but i think it is the problem of linking.
2

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.

3 Comments

In my system library files are installed installed in usr/lib directory, Even though I had set PATH to the usr/lib it is no executing
have you re-defined "size_type" somewhere?
btw you have to reload /etc/environment, check update
1

If you change it to std::size_t it will work but I think the efficient way is to follow the @Velthune's answer.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.