Re: How to load utilities.hpp in a self-built project
Posted by
Luigi Ballabio on
Feb 25, 2017; 2:13pm
URL: http://quantlib.414.s1.nabble.com/How-to-load-utilities-hpp-in-a-self-built-project-tp18108p18113.html
utilities.hpp is just the header and only contains the declarations of the functions. The implementation is in utilities.cpp, and you need to compile and link it together with your main.
Luigi
I tried to use utilities.hpp stored in ...\test-suite\ from Visual-Studio
2015. I tried 3 different ways:
1. Load only boost-library and quantlib directories in Properties ->
Configuration Properties -> VC++ Directories. In the main.cpp file, I write:
#include <iostream>
#include <ql\quantlib.hpp>
#include <test-suite\utilities.hpp>
using namespace QuantLib;
int main() {
std::cout << "Test\n";
system("pause");
return 0;
}
2. Load only boost-library and quantlib directories in Properties ->
Configuration Properties -> VC++ Directories. In the main.cpp file, I write:
#include <iostream>
#include <ql\quantlib.hpp>
#include "test-suite\utilities.hpp"
using namespace QuantLib;
int main() {
std::cout << "Test\n";
system("pause");
return 0;
}
3. Load boost-library and quantlib directories in Properties ->
Configuration Properties -> VC++ Directories. Then load ...\test-suite\ in
"Include Directories". In the main.cpp file, I write:
#include <iostream>
#include <ql\quantlib.hpp>
#include "utilities.hpp"
using namespace QuantLib;
int main() {
std::cout << "Test\n";
system("pause");
return 0;
}
However, none of them worked. I got 9 errors for all the 3 ways I tried:
<http://quantlib.10058.n7.nabble.com/file/n18108/angle-bracket.jpg>
Can anyone please advise how to correctly load utilities.hpp file into a
self-built project? The main.cpp file is super simple... (Please also notice
that if I comment-out the line #include "utilities.hpp", I will get a valid
output).
Thanks!
--
View this message in context: http://quantlib.10058.n7.nabble.com/How-to-load-utilities-hpp-in-a-self-built-project-tp18108.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org!
http://sdm.link/slashdot_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users