Re: [Boost-bugs] [Boost C++ Libraries] #10581: Conflict when using boost::interprocess objects when linking to 2 different boost versions

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10581: Conflict when using boost::interprocess objects when linking to 2 different boost versions
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-24 08:33:57


#10581: Conflict when using boost::interprocess objects when linking to 2
different boost versions
-------------------------------+--------------------------
  Reporter: Yochai Timmer | Owner: igaztanaga
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: interprocess
   Version: Boost 1.55.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------

Comment (by Yochai Timmer):

 The folder name is different, and in the older versions the file name was
 decorated by boost.

 Create 2 projects, a DLL and an executable. Link one project to boost 1.54
 or older (i used 1.51), and the other to boost 1.55.

 Then use the exact same code (different classes for a different name, the
 fact that you cant use the same shared memory object is another issue).


 {{{
 //in Dll1
 struct Test1
 {

 static void OpenSharedMemory() { boost::interprocess::message_queue
 sh(boost::interprocess::open_or_create, "Test1", 20,24); }

 }

 //in The executable
 struct Test2
 {

 static void OpenSharedMemory() { boost::interprocess::message_queue
 sh(boost::interprocess::open_or_create, "Test2", 20,24); }

 }
 }}}



 Now call them in the main function, the second call will always fail (you
 can change the order).


 {{{
 int main(int argc, char* argv[])
 {

 Test1::OpenSharedMemory();
 Test2::OpenSharedMemory();
 return 0;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10581#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC