Subject: [Boost-bugs] [Boost C++ Libraries] #1862: file_lock.hpp will not compile - at least under MSVC8
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-04-24 21:45:06
#1862: file_lock.hpp will not compile - at least under MSVC8
--------------------------------------------------+-------------------------
Reporter: Ranger Harke <rharke.bugs_at_[hidden]> | Owner: igaztanaga
Type: Bugs | Status: new
Milestone: Boost 1.35.1 | Component: interprocess
Version: Boost 1.35.0 | Severity: Problem
Keywords: file_lock |
--------------------------------------------------+-------------------------
Hi,
I'm attempting to use interprocess::file_lock in 1.35.0. Unfortunately, it
will not compile at all in my environment, which is Microsoft Visual
Studio 2005 on WinXP. Merely #include'ing
boost/interprocess/sync/file_lock.hpp causes this failure mode.
A summary of the errors:
{{{
<...> boost/interprocess/sync/file_lock.hpp(167) : error C2535: 'bool
boost::interprocess::file_lock::timed_acquire_file_lock(boost::interprocess::file_handle_t,bool
&,const boost::posix_time::ptime &)' : member function already defined or
declared
e:\dev\cub\boost\boost/interprocess/sync/file_lock.hpp(110) : see
declaration of 'boost::interprocess::file_lock::timed_acquire_file_lock'
<...> boost/interprocess/sync/file_lock.hpp(195) : error C2535: 'bool
boost::interprocess::file_lock::timed_acquire_file_lock_sharable(boost::interprocess::file_handle_t,bool
&,const boost::posix_time::ptime &)' : member function already defined or
declared
e:\dev\cub\boost\boost/interprocess/sync/file_lock.hpp(138) : see
declaration of
'boost::interprocess::file_lock::timed_acquire_file_lock_sharable'
<...> boost/interprocess/sync/file_lock.hpp(119) : error C3861:
'try_acquire_file_lock': identifier not found
<...> boost/interprocess/sync/file_lock.hpp(147) : error C3861:
'try_acquire_file_lock_sharable': identifier not found
<...> boost/interprocess/sync/file_lock.hpp(175) : error C3861:
'try_acquire_file_lock': identifier not found
<...> boost/interprocess/sync/file_lock.hpp(188) : error C3861: 'sleep':
identifier not found
<...> boost/interprocess/sync/file_lock.hpp(203) : error C3861:
'try_acquire_file_lock_sharable': identifier not found
<...> boost/interprocess/sync/file_lock.hpp(262) : error C2039:
'timed_acquire_file_lock' : is not a member of
'boost::interprocess::detail'
<...> boost/interprocess/sync/file_lock.hpp(298) : error C2039:
'timed_acquire_file_lock_sharable' : is not a member of
'boost::interprocess::detail'
}}}
Investigation of file_lock.hpp reveals that:
* Indeed, both timed_acquire_file_lock and
timed_acquire_file_lock_sharable are defined twice ''in their entirety''
* Various functions calls are to functions in incorrect namespaces;
* try_acquire_file_lock, for example, is I believe in
boost::interprocess::detail, which is not in scope (only boost::detail
is).
* I'm not sure what scope sleep is supposed to be in.. there are a few
implementations peppered throughout Boost
I'm not sure if other compilers perhaps have different scoping semantics
and/or different ways of handling function redefinitions, but this
definitely doesn't seem to fly on MSVC8.
A simple reproduction case:
{{{
#include <boost/interprocess/sync/file_lock.hpp>
int main(int argc, char** argv) {
printf("hello world");
return 0;
}
}}}
Really only the inclusion of the header file is necessary, as stated
earlier.
Thanks!
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1862>
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:49:57 UTC