Installing QuantLib using Dev-C++ 4.9.9.2: the examples compile, though I cannot compile any new project - can anyone help?

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

Installing QuantLib using Dev-C++ 4.9.9.2: the examples compile, though I cannot compile any new project - can anyone help?

Bennett, Paul-2
Installing QuantLib using Dev-C++ 4.9.9.2: the examples compile, though I cannot compile any new project - can anyone help?

Help please anyone, I am stuck:

I am using Dev-C++ 4.9.9.2.
I have installed QuantLib 0.3.9 and Boost 1.32.0.

I compiled the "QuantLib.dev" project file, which makes the file "libQuantLib-mgw-0_3_9.a",
required for the "\Dev-C++4.9.9.2\lib" library folder.
(There was actually 1 error in this compilation, though I could not find out what it was?)
I then compiled the "Swap.dev" project found in the "\QuantLib-0.3.9\Examples\Swap" folder.
The resulting executable "Swap-mgw-0_3_9.exe" works exactly as intended outputting the NPVs of a swap. 

That should prove that I have correctly installed Quantlib. 

Next I tried to create a new project, using all the same Project Options as given in project "Swap.dev". 
No matter how simple I made the new project, I have so far not been able to compile successfully;
even simply starting with a blank new project and pasting the code of the Source File
of "Swap.dev" (i.e. pasting the code of "swapvaluation.cpp") into an empty Source File of the new project. 

Even if I do the (harmless) operation of editing out a single "cout" statement in the original Source File "swapvaluation.cpp",

then "Swap.dev" no longer compiles.  Typically, the intial lines of the Compile Log are as follows:

"Compiler: Default compiler                    
Building Makefile: "X:\Quant C++ Files\Risk Management Project C++ Files\Examples\Swap\Makefile.win"                   

Executing  make...                     
make.exe -f "X:\Quant C++ Files\Risk Management Project C++ Files\Examples\Swap\Makefile.win" all                      

g++.exe -c swapvaluation.cpp -o build/mingw/swapvaluation.o -I"X:/Dev-Cpp-4.9.9.2/lib"  -I"lib/gcc/mingw32/3.4.2/include"                      

  -I"include/c++/3.4.2/backward"  -I"include/c++/3.4.2/mingw32"  -I"include/c++/3.4.2"  -I"include"  -I"X:/Dev-Cpp-4.9.9.2/boost"                      

 -I"X:/Dev-Cpp-4.9.9.2/libodbc" -D__GNUWIN32__ -W -fexceptions -finline-functions -DNDEBUG -DNOMINMAX -DWIN32 -D_CONSOLE -D_MBCS                       

swapvaluation.cpp:26:27: ql/quantlib.hpp: No such file or directory                    
swapvaluation.cpp:33: error: expected namespace-name before ';' token                  
swapvaluation.cpp:33: error: `<type error>' is not a namespace                 
swapvaluation.cpp: In function `int main(int, char**)':                
swapvaluation.cpp:44: error: `QL_IO_INIT' undeclared (first use this function)                 
swapvaluation.cpp:44: error: (Each undeclared identifier is reported only once for each function it appears in.)                       

swapvaluation.cpp:44: error: expected `;' before "Calendar"                    
swapvaluation.cpp:47: error: `Date' undeclared (first use this function)                       
swapvaluation.cpp:47: error: expected `;' before "settlementDate"                      
swapvaluation.cpp:49: error: `settlementDate' undeclared (first use this function)                     
swapvaluation.cpp:49: error: `calendar' undeclared (first use this function)                   
swapvaluation.cpp:51: error: `Integer' undeclared (first use this function)"                   

Any suggestions.

Thanks

Paul






Reply | Threaded
Open this post in threaded view
|

Réf. : [Quantlib-users] Installing QuantLib using Dev-C++ 4.9.9.2: the examples compile, though I cannot compile any new project - can anyone help?

K.LAMINE-2

Hi,

the error line that says  "swapvaluation.cpp:26:27: ql/quantlib.hpp: No such file or directory " seems to indicate that the compiler cannot find the quantlib directory.
This is normal, because the project options in swap.dev use relative paths.
In your new project, go to "project options", then "directories".
In "include directories, there must be something like "c:\the directory where you installed quantlib\"
In "library directories", there must be stg like  "c:\the directory where you installed quantlib\lib\"

When you have entered the right parameters, the above error line should disappear and your project should compile.


Karim



"Bennett, Paul" <[hidden email]>
Envoyé par : [hidden email]

05/07/2005 10:51

       
        Pour :        <[hidden email]>
        cc :        
        Objet :        [Quantlib-users] Installing QuantLib using Dev-C++ 4.9.9.2: the examples compile, though I cannot compile any new project - can anyone help?



Help please anyone, I am stuck:

I am using Dev-C++ 4.9.9.2.
I have installed QuantLib 0.3.9 and Boost 1.32.0.

I compiled the "QuantLib.dev" project file, which makes the file "libQuantLib-mgw-0_3_9.a",
required for the "\Dev-C++4.9.9.2\lib" library folder.

(There was actually 1 error in this compilation, though I could not find out what it was?)

I then compiled the "Swap.dev" project found in the "\QuantLib-0.3.9\Examples\Swap" folder.

The resulting executable "Swap-mgw-0_3_9.exe" works exactly as intended outputting the NPVs of a swap.  

That should prove that I have correctly installed Quantlib.  

Next I tried to create a new project, using all the same Project Options as given in project "Swap.dev".  
No matter how simple I made the new project, I have so far not been able to compile successfully;
even simply starting with a blank new project and pasting the code of the Source File

of "Swap.dev" (i.e. pasting the code of "swapvaluation.cpp") into an empty Source File of the new project.  

Even if I do the (harmless) operation of editing out a single "cout" statement in the original Source File "swapvaluation.cpp",

then "Swap.dev" no longer compiles.  Typically, the intial lines of the Compile Log are as follows:

"Compiler: Default compiler                    
Building Makefile: "X:\Quant C++ Files\Risk Management Project C++ Files\Examples\Swap\Makefile.win"                    

Executing  make...                      
make.exe -f "X:\Quant C++ Files\Risk Management Project C++ Files\Examples\Swap\Makefile.win" all                      

g++.exe -c swapvaluation.cpp -o build/mingw/swapvaluation.o -I"X:/Dev-Cpp-4.9.9.2/lib"  -I"lib/gcc/mingw32/3.4.2/include"                      

  -I"include/c++/3.4.2/backward"  -I"include/c++/3.4.2/mingw32"  -I"include/c++/3.4.2"  -I"include"  -I"X:/Dev-Cpp-4.9.9.2/boost"                      

 -I"X:/Dev-Cpp-4.9.9.2/libodbc" -D__GNUWIN32__ -W -fexceptions -finline-functions -DNDEBUG -DNOMINMAX -DWIN32 -D_CONSOLE -D_MBCS                        

swapvaluation.cpp:26:27: ql/quantlib.hpp: No such file or directory                    
swapvaluation.cpp:33: error: expected namespace-name before ';' token                  
swapvaluation.cpp:33: error: `<type error>' is not a namespace                  
swapvaluation.cpp: In function `int main(int, char**)':                
swapvaluation.cpp:44: error: `QL_IO_INIT' undeclared (first use this function)                  
swapvaluation.cpp:44: error: (Each undeclared identifier is reported only once for each function it appears in.)                        

swapvaluation.cpp:44: error: expected `;' before "Calendar"                    
swapvaluation.cpp:47: error: `Date' undeclared (first use this function)                        
swapvaluation.cpp:47: error: expected `;' before "settlementDate"                      
swapvaluation.cpp:49: error: `settlementDate' undeclared (first use this function)                      
swapvaluation.cpp:49: error: `calendar' undeclared (first use this function)                    
swapvaluation.cpp:51: error: `Integer' undeclared (first use this function)"
                   

Any suggestions.

Thanks

Paul





Reply | Threaded
Open this post in threaded view
|

Re: Installing QuantLib using Dev-C++ 4.9.9.2: the examples compile, though I cannot compile any new project - can anyone help?

David Brown-27
In reply to this post by Bennett, Paul-2
Your problem is simple and more elusive than intuition would
indicated.  The referrence directory is not picking up the necessary
library: swapvaluation.cpp:26:27: ql/quantlib.hpp: No such file or
directory.  I came across the same problem.  The problem comes down to
this:  QL is programmed for systems that utilize the forward facing
slash, i.e. c:/..../ql/quantlib.hpp.  Dev C++ is designed for
Windows's standard backwards facing slash.  I have not figured out how
to resolve this in Dev C++ 4 or 5 (beta).

I have tested this problem by changing the slash directions and by
referencing the quantlib.hpp in multiple ways.  One finds easily that
quantlib.hpp can be referrenced by simply getting rid of the "ql/" and
leaving "quantlib.hpp" in a referrenced directory.  This then causes
the problem that every called file from the quantlib.hpp file gives
the directional slash problem.

Terry and I have been trouble-shooting this problem for about two
weeks through private emails.  Perhaps someone knows how to resolve
this.  My answer has been to work on installing the programs on my
BSD-based boxes, but this has proven difficult in some regards.
Perhaps, assumign what all I have written here is correct, we should
approach the Dev C++ 5 beta group and tell them of this directional
slash problem.  It seems easy to resolve, but perhaps not considering
the stark difference between operating system conventions.



David Brown
Ph.D. Candidate
Lehigh University
NSF Fellow


Reply | Threaded
Open this post in threaded view
|

RE: Installing QuantLib using Dev-C++ 4.9.9.2: the examples compile, though I cannot compile any new project - can anyone help?

Bennett, Paul-2
In reply to this post by Bennett, Paul-2
David,

Thanks for your reply.

Looks like I can't use Dev-C++ 4.9.9.2 then!

Paul


-----Original Message-----
From: David Brown [mailto:[hidden email]]
Sent: Tuesday, July 05, 2005 5:41 PM
To: Bennett, Paul
Cc: [hidden email]
Subject: Re: [Quantlib-users] Installing QuantLib using Dev-C++ 4.9.9.2:
the examples compile, though I cannot compile any new project - can
anyone help?


Your problem is simple and more elusive than intuition would
indicated.  The referrence directory is not picking up the necessary
library: swapvaluation.cpp:26:27: ql/quantlib.hpp: No such file or
directory.  I came across the same problem.  The problem comes down to
this:  QL is programmed for systems that utilize the forward facing
slash, i.e. c:/..../ql/quantlib.hpp.  Dev C++ is designed for
Windows's standard backwards facing slash.  I have not figured out how
to resolve this in Dev C++ 4 or 5 (beta).

I have tested this problem by changing the slash directions and by
referencing the quantlib.hpp in multiple ways.  One finds easily that
quantlib.hpp can be referrenced by simply getting rid of the "ql/" and
leaving "quantlib.hpp" in a referrenced directory.  This then causes
the problem that every called file from the quantlib.hpp file gives
the directional slash problem.

Terry and I have been trouble-shooting this problem for about two
weeks through private emails.  Perhaps someone knows how to resolve
this.  My answer has been to work on installing the programs on my
BSD-based boxes, but this has proven difficult in some regards.
Perhaps, assumign what all I have written here is correct, we should
approach the Dev C++ 5 beta group and tell them of this directional
slash problem.  It seems easy to resolve, but perhaps not considering
the stark difference between operating system conventions.



David Brown
Ph.D. Candidate
Lehigh University
NSF Fellow


Reply | Threaded
Open this post in threaded view
|

Re: Installing QuantLib using Dev-C++ 4.9.9.2: the examples compile, though I cannot compile any new project - can anyone help?

Luigi Ballabio
On 07/05/2005 12:05:01 PM, Bennett, Paul wrote:
>
> Looks like I can't use Dev-C++ 4.9.9.2 then!

No, it should work. Dev-C++ is just an IDE; managing statements such as
#include <ql/quantlib.hpp>
is solely responsibility of the C preprocessor, which is the one  
included in the gcc suite and AFAIK handles forward slashes without  
problems (you couldn't even compile the library if it didn't.)

Your problem should be just one of include paths; see Karim's post for  
the solution.

Later,
        Luigi

----------------------------------------

I have made this letter longer than usual, only because I have not had  
the time to make it shorter.
-- B. Pascal



Reply | Threaded
Open this post in threaded view
|

RE: Installing QuantLib using Dev-C++ 4.9.9.2: WORKING

Bennett, Paul-2
In reply to this post by Bennett, Paul-2
Luigi, Karim,

You were both right, thanks for you replies.  I got QuantLib to work using Dev-C++ 4.9.9.2 as follows:

(1) Install Dev-Cpp-4.9.9.2 into a folder of the same name.
(2) Copy the Boost library folder "\boost" into the same folder.
(3) Copy the QuantLib library folder "\ql" into the same folder.

This gives the following directory structure:

DRIVE FOLDER SUBFOLDER
X: \Dev-Cpp-4.9.9.2 \bin
                                \boost (from Boost version 1.32.0)
                                \build
                                \Help
                                \Icons
                                \include
                                \Lang
                                \lib
                                \libexec
                                \mingw32
                                \Packages
                                \ql (from QuantLib version 0.3.9)
                                \Templates

(4) Set Dev-C++ 4.9.9.2 "Tools -> Compiler Options" to have the following:
        Directories: Binaries: X:\Dev-Cpp-4.9.9.2\bin
                                Libraries: X:\Dev-Cpp-4.9.9.2
                                C Includes: X:\Dev-Cpp-4.9.9.2
                                C++ Includes: X:\Dev-Cpp-4.9.9.2

(5) Now open the project file "QuantLib.dev", found in the top directory where the QuantLib files were extracted.
Then "Execute -> Compile". This will create a file "\lib\lib\libQuantLib-mgw-0_3_9.a" in the QuantLib extract directory.  
Save a copy of this file in folder "X:\Dec-Cpp-4.9.9.2\lib".

All done.  To compile any Quantlib project just set the following Project Options:

(6) Within any "*.dev" file, set the "Project -> Project Options" to:
        Parameters: Compiler: -D__GNUWIN32__ -W -fexceptions -finline-functions -DNDEBUG -DWIN32 -D_CONSOLE -D_MBCS -DNOMINMAX
                                C++ compiler: -D__GNUWIN32__ -W -fexceptions -finline-functions -DNDEBUG -DWIN32 -D_CONSOLE -D_MBCS -DNOMINMAX
                                Linker: -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lQuantLib-mgw-0_3_9

        Parameters: Compiler: None
                                C++ compiler: None
                                Linker: None

        Directories: Library Directories: None
                                Include Directories: None
                                Resource Directories: None

This worked for me.

Regards,

Paul


-----Original Message-----
From: Luigi Ballabio [mailto:[hidden email]]
Sent: Tuesday, July 05, 2005 6:58 PM
To: Bennett, Paul
Cc: David Brown; [hidden email]
Subject: Re: [Quantlib-users] Installing QuantLib using Dev-C++ 4.9.9.2:
the examples compile, though I cannot compile any new project - can
anyone help?



On 07/05/2005 12:05:01 PM, Bennett, Paul wrote:
>
> Looks like I can't use Dev-C++ 4.9.9.2 then!

No, it should work. Dev-C++ is just an IDE; managing statements such as
#include <ql/quantlib.hpp>
is solely responsibility of the C preprocessor, which is the one  
included in the gcc suite and AFAIK handles forward slashes without  
problems (you couldn't even compile the library if it didn't.)

Your problem should be just one of include paths; see Karim's post for  
the solution.

Later,
        Luigi

----------------------------------------

I have made this letter longer than usual, only because I have not had  
the time to make it shorter.
-- B. Pascal