Login  Register

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?

Posted by K.LAMINE-2 on Jul 05, 2005; 3:38am
URL: http://quantlib.414.s1.nabble.com/Installing-QuantLib-using-Dev-C-4-9-9-2-the-examples-compile-though-I-cannot-compile-any-new-project-tp3891p3896.html


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