Tuesday, March 29, 2016

Ubuntu 16:04: wt-3.3.5 compile error

When compiling latest wt-3.3.5, the following compile errors can occure: usr/include/boost/core/ref.hpp:131:74: note: candidate: template const boost::reference_wrapper boost::ref(T&)
template BOOST_FORCEINLINE reference_wrapper BOOST_REF_CONST ref( T & t )

^
/usr/include/boost/core/ref.hpp:131:74: note: template argument deduction/substitution failed:
/tmp/wt-3.3.5/test/dbo/DboTest.C: In substitution of ‘template const boost::reference_wrapper
boost::ref(T&) [with T = dbo_test26::test_method()::CheckExpected]’:
/tmp/wt-3.3.5/test/dbo/DboTest.C:2381:76: required from here
/tmp/wt-3.3.5/test/dbo/DboTest.C:2381:76: error: template argument for ‘template const
boost::reference_wrapper boost::ref(T&)’ uses local type ‘dbo_test26::test_method()::CheckExpected’ model->dataChanged().connect(boost::bind(boost::ref(checkExpected),
^
/tmp/wt-3.3.5/test/dbo/DboTest.C:2381:76: error: trying to instantiate ‘template const
boost::reference_wrapper boost::ref(T&)’


This can be fixed, by compiling with C++11 mode: cmake ../ -DWT_CPP_11_MODE:STRING="-std=c++11"

To specify prefix folder (i.e., installation folder): cmake ../ -DWT_CPP_11_MODE:STRING="-std=c++11" -DCMAKE_INSTALL_PREFIX:PATH="/opt/wt"

To build wt libraries as static (i.e. *.a), do: cmake ../ -DWT_CPP_11_MODE:STRING="-std=c++11" -DCMAKE_INSTALL_PREFIX:PATH="/opt/wt" -DSHARED_LIBS=0