# Quantlib error initializing CapFloor C++ Class

I'd like to use QuantLib as a C++ library to price interest rate derivatives, in particular Cap&Floors. To semplify things a little, let's say I have a vector of EURLibor1Y rates for different maturities, which I called r, and a constant caplet volatility which I called vol. When ever I try to set up a Cap/Floor object using the following code

    Volatility vol = 0.180253;
boost::shared_ptr<OptionletVolatilityStructure> vol_ptr = boost::make_shared<ConstantOptionletVolatility>(settlement,cal,ModifiedFollowing,vol,Actual360());
boost::shared_ptr<YieldTermStructure> curve = boost::make_shared<InterpolatedForwardCurve<LogLinear>>(dates,r,Actual360());