example code

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

example code

Kris .
Folks,

i recently got the latest version of STLPort 4.0 and went back
to my quantlib install , to do some sanity tests i tried
compiling and got the following errors.

I would appreciate any pointers.

thanks for your time,
kris

--------------
DiscreteHedging.cpp
c:\program files\quantlib\ql/blackmodel.hpp(91) : error C2039: '_cpp_max' : is not a member of 'std'
c:\program files\quantlib\ql/blackmodel.hpp(91) : error C2065: '_cpp_max' : undeclared identifier
c:\program files\quantlib\ql/Utilities/filteringiterator.hpp(185) : fatal error C1506: unrecoverable block scoping error
Error executing cl.exe.
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8



Reply | Threaded
Open this post in threaded view
|

Re: example code

Luigi Ballabio-4
At 1:25 PM -0500 6/23/02, Kris . wrote:
>i recently got the latest version of STLPort 4.0 and went back
>to my quantlib install , to do some sanity tests i tried
>compiling and got the following errors.
>
>I would appreciate any pointers.

The errors are due to workarounds we had to put in the code because
of nasty practices in Visual Studio's implementation of the STL---and
of course, the workaround leads to errors with a well-behaved
implementation. Argh.

Anyway, it shouldn't be extremely hard to fix with a little help from you.
Namely, can you check how one can determine whether one's using STLPort?
Is there any #define one can test for?

Bye for now,
                Luigi


Reply | Threaded
Open this post in threaded view
|

RE: example code

Jens Thiel
> Namely, can you check how one can determine whether one's using STLPort?
> Is there any #define one can test for?
>

it's

    /* SGI basic release */
    #   define __SGI_STL                                      0x330

    /* Adaptation version */
    #   define __SGI_STL_PORT                                 0x400


and __STL_MSVC which is

    #  define __STL_MSVC _MSC_VER



Jens.



Reply | Threaded
Open this post in threaded view
|

RE: example code

Kris .
In reply to this post by Kris .
Thanks Jens and Luigi for pointing out,
i tried setting config.msvc.hpp the qlmin and qlmax function from stl to _STL::min and _STL::max that seems to have fixed it.

Now i have another STL related question for you folks, i had good luck the last time with the config options to ensure there was no STL io stream since vc seemed to have major hangups about it, i am looking at stl_user_config.h and trying to set
# define   _STLP_NO_OWN_IOSTREAMS 1

but that doesn't seem to go well, can someone tell the best strategy interms of STL+IOStreams+Quantlib project/compile settings.

thanks & regards
kris


----- Original Message -----
From: "Jens Thiel" <[hidden email]>
Date: Mon, 24 Jun 2002 00:39:16 +0200
To: "Kris ." <[hidden email]>, <[hidden email]>
Subject: RE: [Quantlib-users] example code
>

--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8



Reply | Threaded
Open this post in threaded view
|

RE: example code

Luigi Ballabio-4
At 04:45 AM 6/24/02 -0500, Kris . wrote:
>i tried setting config.msvc.hpp the qlmin and qlmax function from stl to
>_STL::min and _STL::max that seems to have fixed it.

Kris,
         thanks to your and Jens' info I just committed into CVS a
config.msvc.hpp which should do the right thing whether STLPort is used or
not. Can you check it? Also, was the _cpp_min/max thing the only issue you
had with our macros?

Thanks,
         Luigi



Reply | Threaded
Open this post in threaded view
|

RE: example code

Kris .
In reply to this post by Kris .
Luigi,

i got a lot of these warnings.

 warning C4284: return type for
'QuantLib::Utilities::filtering_iterator<double const *,class
QuantLib::History::DataValidator>::operator ->' is 'const double *'
(ie; not a UDT or reference to a UDT.  Will p
roduce errors if applied using infix notation)

Seemed innocous to me, rest all looks fine to me.

Thanks & regards
kris



----- Original Message -----
From: Luigi Ballabio <[hidden email]>
Date: Mon, 24 Jun 2002 14:03:57 +0200
To: "Kris ." <[hidden email]>, "Jens Thiel" <[hidden email]>, <quantlib-
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8



Reply | Threaded
Open this post in threaded view
|

Compiling error w/ VC++, STLPort

cheng tang
In reply to this post by Kris .
Hi,

I am encountering the following error while trying to compile the CVS
files. The system is Windows XP, with VC++ 6.0 and STLPort 4.5.3.

The warnings are due to template usage, and error messages are related
to namespcae scoping and standard <ctime> usage in STLPort. If anyone
has any suggestion, please let me know. Thanks!

Here are the error messages.

In Quantlib files project:
--------------------Configuration: QuantLib - Win32 OnTheEdgeDebug--------------------
Compiling...
vols.cpp
c:...\quantlib\ql\utilities\steppingiterator.hpp(65) : warning C4284: return type for 'QuantLib::Utilities::stepping_iterator<double const *>::operator ->' is 'const double *'
(ie; not a UDT or reference to a UDT.  Will produce errors if applied using infix notation)
c:\...\quantlib\ql\math\matrix.hpp(331) : see reference to class template instantiation 'QuantLib::Utilities::stepping_iterator<double const *>' being compiled

c:\...\quantlib\ql\utilities\steppingiterator.hpp(65) : warning C4284: return type for 'QuantLib::Utilities::stepping_iterator<double *>::operator ->' is 'double *' (ie; not a UDT or reference to a UD
T.  Will produce errors if applied using infix notation)

c:\...\quantlib\ql\math\matrix.hpp(335) : see reference to class template instantiation 'QuantLib::Utilities::stepping_iterator<double *>' being compiled

c:\...\quantlib\ql\volatilities\blackvariancesurface.hpp(52) : error C2653: 'DayCounters' : is not a class or namespace name

c:\...\quantlib\ql\volatilities\blackvariancesurface.hpp(69) : see reference to class template instantiation 'QuantLib::VolTermStructures::BlackVarianceSurface<Interpolator2D>' being compiled

c:\...\quantlib\ql\volatilities\blackvariancesurface.hpp(52) : error C2653: 'DayCounters' : is not a class or namespace name

c:\...\quantlib\ql\functions\vols.cpp(61) : see reference to class template instantiation 'QuantLib::VolTermStructures::BlackVarianceSurface<class QuantLib::Math::BilinearInterpolation<double
const *,double const *,class QuantLib::Math::Matrix> >' being compiled
Error executing cl.exe.

QuantLib_d.lib - 2 error(s), 2 warning(s)


In example projects:

--------------------Configuration: BermudanSwaption - Win32 OnTheEdgeDebug--------------------
Compiling...
BermudanSwaption.cpp
c:\program files\microsoft visual studio\vc98\include\stlport\ctime(33) : error C2039: 'clock_t' : is not a member of '`global namespace''
c:\program files\microsoft visual studio\vc98\include\stlport\ctime(33) : error C2873: 'clock_t' : symbol cannot be used in a using-declaration
c:\documents and settings\...\quantlib\ql\utilities\filteringiterator.hpp(185) : fatal error C1506: unrecoverable block scoping error
Error executing cl.exe.

BermudanSwaption.exe - 3 error(s), 0 warning(s)