Problem with shared version of Boost.Regex library

Hi all, I compiled a shared version (DLL) of Boost.Regex on Windows2000 Pro with gcc 3.4.5, mingw 3.13, STLport 5.1.4 and IBM's ICU 3.8. Details are as below: 1. Open file "boost/config/platform/win32.hpp", change the line: #if !defined(__GNUC__) && !defined(BOOST_HAS_DECLSPEC) to: #if (!defined(__GNUC__) || defined(__MINGW32__)) && !defined(BOOST_HAS_DECLSPEC) I did this because mingw (at least with my version) supports both __declspec(dllexport) and __declspec(dllimport), and __GNUC__ is also defined. 2. Open file "boost/regex/user.hpp" and uncomment 2 lines: "#define BOOST_HAS_DLL_RUNTIME 1" and "#define BOOST_REGEX_DYN_LINK 1". 3. Edit file "libs/regex/build/gcc-shared.mak" and then use it to build Boost.Regex from MSYS shell with GNU Make. After the building process completed, I wrote a small program to test the output. It ran nicely but I got the following warning when linking against Boost.Regex: ../../include/boost/regex/pending/static_mutex.hpp:116: warning: 'bool boost::scoped_static_mutex_lock::locked() const' defined locally after being referenced with dllimport linkage It seems my compiler doesn't like to see "inline" and "__declspec(dllimport)" in the same place. So I have some questions: 1. Should I remove "inline" and rebuild Boost.Regex to skip this warning ? 2. Should I continue to use my own shared version of Boost.Regex ? May it result in such thing like undefined behavior, especially in multithread world ? Can anyone give me a hint, please ? Thanks in advance. P.S: STLport and ICU were built as shared libraries, I therefore dont like a static build of Boost.Regex at all. --------------------------------- Thức ăn hữu cơ - thức ăn lành mạnh có lợi cho sức khỏe như thế nào? Khám phá tại Yahoo! Hỏi & Đáp

ancode tran wrote:
../../include/boost/regex/pending/static_mutex.hpp:116: warning: 'bool boost::scoped_static_mutex_lock::locked() const' defined locally after being referenced with dllimport linkage
It seems my compiler doesn't like to see "inline" and "__declspec(dllimport)" in the same place. So I have some questions: 1. Should I remove "inline" and rebuild Boost.Regex to skip this warning ? 2. Should I continue to use my own shared version of Boost.Regex ? May it result in such thing like undefined behavior, especially in multithread world ?
Can anyone give me a hint, please ? Thanks in advance.
Hmm, it should be OK, I don't believe you can remove the "__declspec(dllimport)" since that refers to the whole class: which does have some functions in a separate .cpp file. I don't really see why gcc would compain about this to be honest. HTH, John.
participants (2)
-
ancode tran
-
John Maddock