trouble using quantlib with mfc windows application

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

trouble using quantlib with mfc windows application

svangipu
hi:
i am unable to compile code when i included a couple of lines of code
in a mfc windows application. the same code compiles when i create a
dos console application under vsnet 2002.
here are the line of code i tried:
FdEuropean callOption = FdEuropean(Option::Call, currentPrice,
strikePrice, divYield, riskFree, optionLife, vol);

the errors i get are
'(' illegal token on right side of:: in file fdbsmoption.hpp
at line 81 which is
 inline Size FdBsmOption::safeGridPoints(Size gridPoints,
                                            Time residualTime) {
        return QL_MAX(gridPoints, residualTime>1.0 ?
                      static_cast<Size>((QL_NUM_OPT_MIN_GRID_POINTS +
                                         (residualTime-1.0) *
                                         QL_NUM_OPT_GRID_POINTS_PER_YEAR))
                      : QL_NUM_OPT_MIN_GRID_POINTS);
   
this code compiles find for win32 cosole apps.. problem is there only
for windows app using mfc and winapi..

is there some compiler setting i need to compile this correctly?.. if
anyone has a simple windows app that uses quantlib could you please
send it to me with the workspace, project files etc..

thanks and any help is appreicated...


Reply | Threaded
Open this post in threaded view
|

Re: trouble using quantlib with mfc windows application

Luigi Ballabio
On 01/14/05 03:47:56, Satish Vangipuram wrote:
> i am unable to compile code when i included a couple of lines of code
> in a mfc windows application. the same code compiles when i create a
> dos console application under vsnet 2002.

Ouch. The only thing I can think of is that MFC defines some macro which is  
interfering with the code... may you try running the preprocessor (not the  
compiler) on your source and check what the compiler actually sees at line  
81 of fdbsmoption.hpp?  I don't know how to do it from the IDE, but you can  
try "cl /E" or "cl /P" at the command line (you might have to provide  
include paths as well.)

Later,
        Luigi