It's probably a bit late to give an answer to this thread, but I can probably add some.
I have used boost versions from 1.51 through 1.54 in the past together with Qt 4.8 through 5.1 on Windows 7.
I use boost from within a top-level boost folder with subfolders for each version (e.g. C:\Program Files\Boost\boost_1_53_0 etc.) The libraries and includes are in /stage/lib and /boost respectively. I have an environment variable named boost to point to the desired boost version. Finally, to use boost from within Qt, I add the following two lines to the project file:
@
INCLUDEPATH += $$(boost)
LIBS += -L"$$(boost)/stage/lib/"
@
This works for both, g++ and MSVC. However, for g++ I need to add any libraries with an additional:
@
win32-g++ {
BOOST_TARGET = mgw48-mt-s-1_54
LIBS += -lboost_filesystem-$${BOOST_TARGET}
-lboost_chrono-$${BOOST_TARGET}
-lboost_system-$${BOOST_TARGET}
}
@
I have run into similar problems with (boost::) filesystem, exception and posix_time. (I haven't used regex that much). I could address the issue by excluding the boost headers from MOC:
@
#ifndef Q_MOC_RUN
#include <boost/exception/all.hpp>
#include <boost/filesystem.hpp>
#endif
@
It is not the most ideal solution but it is absoultely portable.
This solution is also mentioned "here:":https://bugreports.qt-project.org/browse/QTBUG-22829?focusedCommentId=176766&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-176766
I have to add that the problem was most apparent in Qt 4.8. With Qt 5.0 I was able to remove a number of boost headers from the "MOC_RUN cage". I have not revisited all my code with Qt 5.1, so there might be even less.
Willi