http://quantlib.414.s1.nabble.com/C-11-Compilation-errors-on-examples-tp965.html
Just for fun I decided to have a go at compiling trunk (r18307) with GCC 4.7 in C++-11 mode. To my surprise it pretty much compiled OK - except for the examples, where I got the error I attach at the end of the email. I must apologise if this has already been discussed in the list but I'm really struggling to search it properly from either SourceForge, Nabble or GMane - consistently get no relevant matches. My questions are:
- has anyone succeeded in compiling QuantLib C++-11 (e.g. there is a patch somewhere for this problem)? I am linear-searching the archives but haven't bumped into anything as of yet.
- I noticed there is a enable-examples flag in configure but this seems to only have an impact distribution-wise; is there way of not compiling the examples (or just the experimental examples even)?
Many thanks for your time.
g++-4.7 -DHAVE_CONFIG_H -I. -I../../ql -I../.. -I../.. -isystem /usr/local/pfh/include -isystem /usr/local/pfh/include -std=c++11 -MT CDS.o -MD -MP -MF .deps/CDS.Tpo -c -o CDS.o CDS.cpp
In file included from ../../ql/experimental/math/all.hpp:4:0,
from ../../ql/experimental/all.hpp:17,
from ../../ql/quantlib.hpp:42,
from CDS.cpp:20:
../../ql/experimental/math/autocovariance.hpp: In function ‘std::vector<std::complex<double> > QuantLib::detail::double_ft(ForwardIterator, ForwardIterator)’:
../../ql/experimental/math/autocovariance.hpp:47:78: error: no matching function for call to ‘transform(std::vector<std::complex<double> >::iterator, std::vector<std::complex<double> >::iterator, QuantLib::Array::iterator, <unresolved overloaded function type>)’
../../ql/experimental/math/autocovariance.hpp:47:78: note: candidates are:
In file included from /usr/local/pfh/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/algorithm:63:0,
from /usr/local/pfh/include/boost/smart_ptr/shared_ptr.hpp:41,
from /usr/local/pfh/include/boost/shared_ptr.hpp:17,
from ../../ql/errors.hpp:31,
from ../../ql/patterns/observable.hpp:29,
from ../../ql/event.hpp:29,
from ../../ql/cashflow.hpp:28,
from ../../ql/quantlib.hpp:10,
from CDS.cpp:20:
/usr/local/pfh/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_algo.h:4897:5: note: template<class _IIter, class _OIter, class _UnaryOperation> _OIter std::transform(_IIter, _IIter, _OIter, _UnaryOperation)
/usr/local/pfh/lib/gcc/x86_64-unknown-linux-gnu/4.7.0/../../../../include/c++/4.7.0/bits/stl_algo.h:4897:5: note: template argument deduction/substitution failed:
In file included from ../../ql/experimental/math/all.hpp:4:0,
from ../../ql/experimental/all.hpp:17,
from ../../ql/quantlib.hpp:42,
from CDS.cpp:20:
../../ql/experimental/math/autocovariance.hpp:47:78: note: could not resolve address from overloaded function ‘norm<QuantLib::Real>’
threat landscape has changed and how IT managers can respond. Discussions
threats.