Posted by
Luigi Ballabio-2 on
URL: http://quantlib.414.s1.nabble.com/problem-to-compile-template-with-borland-C-5-6-tp2174p2175.html
At 02:57 PM 9/10/02 +0200,
[hidden email] wrote:
>then this call:
>
>Handle<RateHelper> d1y(new DepositRateHelper(
> d1yQuote, 2,
> 1, Years, calendar, ModifiedFollowing, depositDayCounter));
>
>gives me the error:
>
>[C++ Error] Unit1.cpp(51): E2108 Improper use of typedef 'RateHelper'
>
>this call
>
>QuantLib::Handle<RateHelper> d1y(new DepositRateHelper(
> d1yQuote, 2,
> 1, Years, calendar, ModifiedFollowing, depositDayCounter));
>
>
>It compiles well but when I launch it there is a crash with an error:
> "raised exception class EAccess Violation"
Hmm. Hard to say without seeing the rest of the code.
First of all, I assume you are including "ql/quantlib.hpp", so that rate
helpers are included as well. Now, the declaration above with all types
fully specified should read:
QuantLib::Handle<QuantLib::TermStructures::RateHelper> d1y(
new QuantLib::TermStructures::DepositRateHelper(
d1yQuote, 2,
1, QuantLib::Years, calendar, QuantLib::ModifiedFollowing,
depositDayCounter));
You might remove some of the namespace specifications using "using"
directives such as
using QuantLib::TermStructures::RateHelper;
the same applies to Calendar, TARGET, and any other QuantLib class.
In short, make sure that the compiler knows in which namespace to find each
class. If that doesn't help, I'll try to think of something else...
Later,
Luigi