Replace #elif preprocessor commands by #else #if because gcc seems to like them more. Otherwise gcc does not compile BOOST_PP file iterations. Unfornunately, gcc 4.8.2 segfaults on BOOST 1.54 PP local file iterations. Clang compiles just fine.