[SOLVED] Qt Creator on OS X cannot find armadillo



  • Qt Creator 3.1.1 cannot find armadillo under OS X 10.9.3. I have installed armadillo 4.300.5 using the cmake install, and I have armadillo entries under /usr/include and libarmadillo in /usr/lib. When typing #include <a, Qt Creator suggests armadillo for autocomplete, meaning that Qt Creator indeed finds the lib. But trying to compile the program only gives the error
    'armadillo' file not found
    with a red ! on the #include line. Here is a MWE:
    @
    #include <armadillo>

    using namespace std;

    int main()
    {
    arma::mat A;
    return 0;
    }
    @

    with .pro-file
    @
    TEMPLATE = app
    CONFIG += console
    CONFIG -= app_bundle
    CONFIG -= qt

    SOURCES += main.cpp

    LIBS += -larmadillo
    @

    I am using the default Desktop qt clang 64bit compiler option.
    Thanks for any input!


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you try adding /usr/lib to the list of known folder ?



  • Where is that list located? I cannot find it in the Preferences of Qt Creator.


  • Lifetime Qt Champion

    For you project:

    @LIBS += -L/usr/lib@



  • Yes, I tried both the line you posted and also
    @LIBS += -L/usr/lib -larmadillo@
    I have also tried to right-click the project and select "Add Library...", but
    I get the same error message.

    EDIT:
    If I do
    @clang -O3 -o test -larmadillo main.cpp@
    in the terminal it compiles just fine.

    EDIT2:
    It seems I needed to add the includes directory,
    @INCLUDEPATH += /usr/include@
    Now it works =)



  • This is not yet solved...
    I'm running on Ubuntu 14.04 with Qt Creator 3.1.0 (opensource)



  • on macOs add this to .pro

    install armadillo: brew install armadillo

    brew list armadillo

    INCLUDEPATH += /usr/local/Cellar/armadillo/8.200.2/include/
    LIBS += -L/usr/local/Cellar/armadillo/8.200.2/lib/ -larmadillo


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.