[Boost-bugs] [Boost C++ Libraries] #3090: Include file_lock.hpp in two compilation units results in multiple definitions at link time (win32)

Subject: [Boost-bugs] [Boost C++ Libraries] #3090: Include file_lock.hpp in two compilation units results in multiple definitions at link time (win32)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-26 15:07:31


#3090: Include file_lock.hpp in two compilation units results in multiple
definitions at link time (win32)
------------------------------------------------+---------------------------
 Reporter: jkp_at_[hidden] | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: interprocess
  Version: Boost 1.39.0 | Severity: Showstopper
 Keywords: multiple definition symbol windows |
------------------------------------------------+---------------------------
 Including the file #include "boost/interprocess/sync/file_lock.hpp" from
 two seperate compilation units results in multiply defined symbols.

 The reason is that the following symbols contain nested class definitions.

 static inline bool unlink_file(const char *filename);
 static inline bool get_file_name_from_handle_function
    (void * hFile, wchar_t *pszFilename, std::size_t length, std::size_t
 &out_length);

 Moving the definitions for the functions to a source file and compiling
 that into the library instead solves the issue.

 You can prove that the issue is the nested structs / classes by commenting
 out the function bodies.

 This is a pretty serious issue since it pretty much means you cannot use
 boost interprocess under windows right now.

 I'm compiling under MSVC8.1. The issue does not present itself under GCC,
 but then, these function implementations are win32 specific.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3090>
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:00 UTC