Unable to build polygonExample: undefined reference to boost::filesystem::detail::directory_iterator_construct

After installing OpenFrameworks-0.11 on Ubuntu 18.04 using both the stable and the nightie versions, I’m unable to build the polygon example with make because of an error related to Boost’s filesystem module. I’ve actually built boost from source and tested the filesystem module in a separate script, and have also made sure libboost-dev wasn’t installed with apt.

Anyone knows how to fix this error:

/home/hakim/repos/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofFileUtils.o):ofFileUtils.cpp:function ofDirectory::isDirectoryEmpty(boost::filesystem::path const&, bool): error: undefined reference to 'boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, unsigned int, boost::system::error_code*)'
/home/hakim/repos/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofFileUtils.o):ofFileUtils.cpp:function ofDirectory::copyTo(boost::filesystem::path const&, bool, bool): error: undefined reference to 'boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, unsigned int, boost::system::error_code*)'
/home/hakim/repos/of_v0.11.0_linux64gcc6_release/libs/openFrameworksCompiled/lib/linux64/libopenFrameworks.a(ofFileUtils.o):ofFileUtils.cpp:function ofDirectory::listDir(): error: undefined reference to 'boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, unsigned int, boost::system::error_code*)'
collect2: error: ld returned 1 exit status
make[1]: *** [bin/polygonExample] Error 1
make: *** [Release] Error 2

As suggested in this issue on github, I fixed it by removing boost that had been compiled from source before (with a simple rm -rf /usr/local/lib/libboost* /usr/local/include/boost), and let OF install it when downloading its dependencies.