|
From: Jonathan S. <sw...@gm...> - 2024-09-27 22:55:20
|
Hi Christofer,
Is your hello world program in the same custom folder where you installed
QuantLib? If so then the best thing to do would be to make a new separate
directory for your hello world program and then pass the QuantLib include
directory to the compiler using the `-I` flag.
2024년 9월 28일 (토) 05:27, Christofer Bogaso <bog...@gm...>님이
작성:
> Thanks Amine. Any suggestion how can I sort out the header files
> search path in VScode?
>
> On Sat, Sep 28, 2024 at 1:40 AM Amine Ifri <ami...@gm...> wrote:
> >
> > Sounds like an issue with the header file naming convention IMO. Make
> sure you sort out your your header files search path relative to where
> your put your main.cpp, as c++ tends to complain about this sometimes.
> >
> > On Fri, 27 Sep 2024 at 19:59, Christofer Bogaso <
> bog...@gm...> wrote:
> >>
> >> Hi,
> >>
> >> I installed Quantlib in a custom folder, and then ran following 'Hello
> >> World' code
> >>
> >> #include <iostream>
> >> #include <ql/interestrate.hpp>
> >>
> >> int main()
> >> {
> >> std::cout << "Hello World" << std::endl;
> >> }
> >>
> >> Above code fails with below error message
> >>
> >> Starting build...
> >> /usr/bin/g++ -fdiagnostics-color=always -g
> >> /Users/XXX/QuantLib/QL/include/Custom_Date.cpp -o
> >> /Users/XXX/QuantLib/QL/include/Custom_Date
> >> /Users/XXX/QuantLib/QL/include/Custom_Date.cpp:2:10: error:
> >> 'ql/interestrate.hpp' file not found with <angled> include; use
> >> "quotes" instead
> >> 2 | #include <ql/interestrate.hpp>
> >> | ^~~~~~~~~~~~~~~~~~~~~
> >> | "ql/interestrate.hpp"
> >> In file included from /Users/XXX/QuantLib/QL/include/Custom_Date.cpp:2:
> >> /Users/XXX/QuantLib/QL/include/ql/interestrate.hpp:27:10: fatal error:
> >> 'ql/compounding.hpp' file not found
> >> 27 | #include <ql/compounding.hpp>
> >> | ^~~~~~~~~~~~~~~~~~~~
> >> 2 errors generated.
> >>
> >> Build finished with error(s).
> >>
> >> * The terminal process failed to launch (exit code: -1).
> >> * Terminal will be reused by tasks, press any key to close it.
> >>
> >> I am using Mac and VScode to run the C++ code.
> >>
> >> Could you please suggest if I need to perform anything specific to run
> >> above code? I mostly followed the instructions in
> >> https://www.quantlib.org/install/macosx.shtml to install Quantlib in
> >> my Mac.
> >>
> >> Any pointer will be very helpful.
> >>
> >> Many thanks,
> >>
> >>
> >> _______________________________________________
> >> QuantLib-users mailing list
> >> Qua...@li...
> >> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|