Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Adding Eigen and Armadillo library



  • Hello everyone,
    Recently I have been trying to use a math library to a console application for solving some matrix cases. However I have found some issues the library.

    I cant add the library with the includepath command

    This is my .pro file

    QT -= gui
    
    CONFIG += c++11 console
    CONFIG -= app_bundle
    
    # The following define makes your compiler emit warnings if you use
    # any Qt feature that has been marked deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if it uses deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    SOURCES += \
            main.cpp
    
    INCLUDEPATH += C:\Users\10alv\Documents\Armadillo Libreria\Eigen 3.2\eigen-3.2.10\Eigen
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    

    I unzip the .rar that I downloaded in the path: C:\Users\10alv\Documents\Armadillo Libreria\Eigen 3.2\eigen-3.2.10
    And in this file, I understand that just need the folder Eingen that its inside and it contains the file of the library.
    But the code dont recognize any of file of this file. For examplo, for use a matrix I need use the command

    #include <Dense>
    

    But Qt doesnt recognize this file. Thanks for your help.


  • Lifetime Qt Champion

    @Dooham said in Adding Eigen and Armadillo library:

    C:\Users\10alv\Documents\Armadillo Libreria\Eigen 3.2\eigen-3.2.10\Eigen

    There is a space inside the path - you have to quote it. Take a look at the compiler options when compiling and you will see that the include path is given wrong to the compiler.



  • Thanks there were the issue. I change the path and now it works.


Log in to reply