|
Boost Users : |
From: ancode tran (ancodecpp_at_[hidden])
Date: 2007-11-12 13:03:08
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
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net