Results 1 to 2 of 2

Thread: QuantLib

  1. #1
    Join Date
    Nov 2012
    Posts
    24
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QuantLib

    Hello,

    I want to make use of QuantLib, especially for converting a date into a serialnumber.
    When I run the program below I get the error:
    mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall QuantLib:ate:ate(int,enum QuantLib::Month,int)" (??0Date@QuantLib@@QAE@HW4Month@1@H@Z) referenced in function "private: class QuantLib:ate __thiscall MainWindow::date1(void)const " (?date1@MainWindow@@ABE?AVDate@QuantLib@@XZ)

    I tried a lot, but still can't figure it out.
    Can someone give me a hint?

    Regards,
    Arend

    My .pro file:
    Qt Code:
    1. QT += core gui
    2. INCLUDEPATH += . C:/Libs/boost_1_46_1 C:/Libs/QuantLib-1.1
    3. LIBS += -LC:/Libs/QuantLib-1.1/lib
    4. TARGET = testQuantLib
    5. TEMPLATE = app
    6. SOURCES += main.cpp\
    7. mainwindow.cpp
    8. HEADERS += mainwindow.h
    9. FORMS += mainwindow.ui
    To copy to clipboard, switch view to plain text mode 


    My .h file
    Qt Code:
    1. #ifndef MAINWINDOW_H
    2. #define MAINWINDOW_H
    3.  
    4. #include <QMainWindow>
    5. #include <ql/time/date.hpp>
    6.  
    7. namespace Ui {
    8. class MainWindow;
    9. }
    10.  
    11. class MainWindow : public QMainWindow
    12. {
    13. Q_OBJECT
    14.  
    15. public:
    16. explicit MainWindow(QWidget *parent = 0);
    17. ~MainWindow();
    18.  
    19. private:
    20. Ui::MainWindow *ui;
    21. QuantLib::Date date1() const;
    22. };
    23. #endif // MAINWINDOW_H
    To copy to clipboard, switch view to plain text mode 

    Mu .cpp file:
    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3. #include <QDebug>
    4.  
    5. MainWindow::MainWindow(QWidget *parent) :
    6. QMainWindow(parent),
    7. ui(new Ui::MainWindow)
    8. {
    9. ui->setupUi(this);
    10. QuantLib::Date dateOld=this->date1();
    11. }
    12.  
    13. MainWindow::~MainWindow()
    14. {
    15. delete ui;
    16. }
    17.  
    18. QuantLib::Date MainWindow::date1() const {
    19. QDate date=ui->curveDate->date();
    20. QuantLib::Date d(date.day(),(QuantLib::Month)date.month(),date.year());
    21. return d;
    22. }
    To copy to clipboard, switch view to plain text mode 


    Added after 23 minutes:


    I solved it: added #include <ql/auto_link.hpp> somewhere in the program.
    Last edited by Arend; 15th March 2013 at 09:02.

  2. #2
    Join Date
    Nov 2012
    Posts
    24
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QuantLib

    I solved it: added #include <ql/auto_link.hpp> somewhere in the program.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.