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

QAMQP c++ ("forward declaration of class")



  • Hi, I´m using this library QAmqp and I compiled this and their examples are ok. It´s possible to send and receive messages from different terminals.

    This library implement a amqp protocol 0.9.1 on RabbitMQ.

    I´m trying to use this library as static lib into my app and I put all code inside my project.

    When I start the compiler :

    #include <QObject>
    #include "qamqpglobal.h"
    
    class QAmqpClient;
    class QAmqpChannelPrivate;
    class QAMQP_EXPORT QAmqpChannel : public QObject
    {
        Q_OBJECT
        Q_PROPERTY(int number READ channelNumber CONSTANT)
        Q_PROPERTY(bool open READ isOpen CONSTANT)
        Q_PROPERTY(QString name READ name WRITE setName)
    

    I found this error: "forward declaration of class QAmqpChannerPrivate"

    There is no documentation about use this library and I don´t know how to include this library and use it correctly.

    Thanks in advance.


  • Lifetime Qt Champion

    Hi,

    Can you show how you use it ?
    Where exactly does the error happen ?



  • SGaist, Let me try...

    I copied all the library project to a qamqp directory inside of my project.

    My pro file:

    PRIVATE_HEADERS += \
        qamqp/src/qamqpchannel_p.h \
        qamqp/src/qamqpchannelhash_p.h \
        qamqp/src/qamqpclient_p.h \
        qamqp/src/qamqpexchange_p.h \
        qamqp/src/qamqpframe_p.h \
        qamqp/src/qamqpmessage_p.h \
        qamqp/src/qamqpqueue_p.h
    
    INSTALL_HEADERS += \
        qamqp/src/qamqpauthenticator.h \
        qamqp/src/qamqpchannel.h \
        qamqp/src/qamqpclient.h \
        qamqp/src/qamqpexchange.h \
        qamqp/src/qamqpglobal.h \
        qamqp/src/qamqpmessage.h \
        qamqp/src/qamqpqueue.h \
        qamqp/src/qamqptable.h
    
    HEADERS += \
        $${INSTALL_HEADERS} \
        $${PRIVATE_HEADERS}
    
    SOURCES += \
        qamqp/src/qamqpauthenticator.cpp \
        qamqp/src/qamqpchannel.cpp \
        qamqp/src/qamqpchannelhash.cpp \
        qamqp/src/qamqpclient.cpp \
        qamqp/src/qamqpexchange.cpp \
        qamqp/src/qamqpframe.cpp \
        qamqp/src/qamqpmessage.cpp \
        qamqp/src/qamqpqueue.cpp \
        qamqp/src/qamqptable.cpp
    

    I have a class called base. I put these methods inside this class:

    void Base::start() {
        QObject::connect(&m_client, SIGNAL(connected()), this, SLOT(clientConnected()));
        m_client.connectToHost();
    }
    
    void Base::clientConnected() {
        QAmqpExchange *exchange = m_client.createExchange("logs");
        connect(exchange, SIGNAL(declared()), this, SLOT(exchangeDeclared()));
        exchange->declare(QAmqpExchange::FanOut);
    }
    
    void Base::exchangeDeclared() {
        QAmqpQueue *temporaryQueue = m_client.createQueue();
        connect(temporaryQueue, SIGNAL(declared()), this, SLOT(queueDeclared()));
        connect(temporaryQueue, SIGNAL(bound()), this, SLOT(queueBound()));
        connect(temporaryQueue, SIGNAL(messageReceived()), this, SLOT(messageReceived()));
        temporaryQueue->declare(QAmqpQueue::Exclusive);
    }
    
    void Base::queueDeclared() {
        QAmqpQueue *temporaryQueue = qobject_cast<QAmqpQueue*>(sender());
        if (!temporaryQueue)
            return;
    
        temporaryQueue->bind("logs", temporaryQueue->name());
    }
    
    void Base::queueBound() {
        QAmqpQueue *temporaryQueue = qobject_cast<QAmqpQueue*>(sender());
        if (!temporaryQueue)
            return;
    
        qDebug() << " [*] Waiting for logs. To exit press CTRL+C";
        temporaryQueue->consume(QAmqpQueue::coNoAck);
    }
    
    void Base::messageReceived() {
        QAmqpQueue *temporaryQueue = qobject_cast<QAmqpQueue*>(sender());
        if (!temporaryQueue)
            return;
    
        QAmqpMessage message = temporaryQueue->dequeue();
        qDebug() << " [x] " << message.payload();
    }
    

    0_1551474549100_Captura de tela de 2019-03-01 18-07-46.png


  • Lifetime Qt Champion

    Did you first try to compile the library itself before copying it into your own project ?



  • yes...But the lib file was created but not linked with the examples. I need to copy these lib files to example directory to run.

    Now, I include this at my pro.

    #qamqp
    
    DEPTH = ../qamqp
    include($${DEPTH}/qamqp.pri)
    
    INCLUDEPATH += $${QAMQP_INCLUDEPATH}
    LIBS += -L$${DEPTH}/src $${QAMQP_LIBS}
    macx:CONFIG -= app_bundle
    
    #qamqp
    

    and this is the pri file

    QAMQP_VERSION = 0.5.0
    
    isEmpty(QAMQP_LIBRARY_TYPE) {
        QAMQP_LIBRARY_TYPE = shared
    }
    
    QT += network
    QAMQP_INCLUDEPATH = $${PWD}/src
    QAMQP_LIBS = -lqamqp
    CONFIG(debug, debug|release){
        #QAMQP_LIBS = -lqamqpd
    }
    contains(QAMQP_LIBRARY_TYPE, staticlib) {
        DEFINES += QAMQP_STATIC
    } else {
        DEFINES += QAMQP_SHARED
        win32:QAMQP_LIBS = -lqamqp0
    }
    
    isEmpty(PREFIX) {
        unix {
            PREFIX = /usr
        } else {
            PREFIX = $$[QT_INSTALL_PREFIX]
        }
    }
    isEmpty(LIBDIR) {
        LIBDIR = lib
    }
    

    The compilation is ok, but:

    SaborDelivery...
    /mnt/midia4/prj/qt/build-SaborDelivery-Desktop_Qt_5_11_1_GCC_64bit-Debug/SaborDelivery: error while loading shared libraries: libqamqp.so.0: cannot open shared object file: No such file or directory

    So, I copied these files (libqamqp.so, libqamqp.so.0, libqamqp.so.0.5, libqamqp.so.0.5.0 ) to my build directory and it´s possible to run my app by CLI.

    I changed QAMQP_LIBRARY_TYPE from "shared" to "staticlib" without sucess.


  • Lifetime Qt Champion

    When using custom libraries, you can set the LD_LIBRARY_PATH to contain the path to where your library of interest is.



  • I set the LD_LIBRARY_PATH and now it´s contain the path.

    I created a directory qamqp inside /opt/Qt/5.8/gcc_64/lib/qamqp
    I added this line below at the end of my .bashrc :

    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib/qamqp

    Now it´s possible to run my app inside Qt Creator.

    So I made a deploy using my deploy script (this script is ok to another project) to make a package.

    /opt/Qt/$QTVER/gcc_64/bin/qmake PREFIX=/usr
    make -j$(nproc)
    unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
    ../linuxdeployqt*.AppImage $1 -bundle-non-qt-libs -qmake=/opt/Qt/$QTVER/gcc_64/bin/qmake 
    ../linuxdeployqt*.AppImage $1 -appimage -qmake=/opt/Qt/$QTVER/gcc_64/bin/qmake -extra-plugins=/opt/Qt/$QTVER/gcc_64/lib/qamqp
    ../linuxdeployqt*.AppImage $1 -e -qmake=/opt/Qt/$QTVER/gcc_64/bin/qmake -extra-plugins=/opt/Qt/$QTVER/gcc_64/lib/qamqp
    

    There is an linker error:
    ERROR: ldd outputLine: "/mnt/midia4/prj/qt/deploy2/SaborDelivery/SaborDelivery: /opt/Qt/5.8/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /mnt/midia4/prj/qt/deploy2/SaborDelivery/SaborDelivery)"

    this is the ldd Sabordelivery results
    SaborDelivery/SaborDelivery: /opt/Qt/5.8/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by SaborDelivery/SaborDelivery)
    linux-vdso.so.1 (0x00007ffc4e536000)
    libqamqp.so.0 => not found
    libQt5PrintSupport.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5PrintSupport.so.5 (0x00007f2549aa6000)
    libQt5Widgets.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Widgets.so.5 (0x00007f2549275000)
    libQt5Multimedia.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Multimedia.so.5 (0x00007f2548f6b000)
    libQt5Gui.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Gui.so.5 (0x00007f25487d0000)
    libQt5Sql.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Sql.so.5 (0x00007f2548589000)
    libQt5Xml.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Xml.so.5 (0x00007f254834f000)
    libQt5Network.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Network.so.5 (0x00007f2547fc9000)
    libQt5Core.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Core.so.5 (0x00007f25478a9000)
    libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f254760f000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f25473f2000)
    libpulse-mainloop-glib.so.0 => /usr/lib/x86_64-linux-gnu/libpulse-mainloop-glib.so.0 (0x00007f25471ed000)
    libpulse.so.0 => /usr/lib/x86_64-linux-gnu/libpulse.so.0 (0x00007f2546f9c000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f2546c8d000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2546982000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2546681000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f254646b000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f25460c0000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2545ea5000)
    libicui18n.so.56 => /opt/Qt/5.8/gcc_64/lib/libicui18n.so.56 (0x00007f2545a0c000)
    libicuuc.so.56 => /opt/Qt/5.8/gcc_64/lib/libicuuc.so.56 (0x00007f2545654000)
    libicudata.so.56 => /opt/Qt/5.8/gcc_64/lib/libicudata.so.56 (0x00007f2543c71000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2543a6d000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f2543865000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f2543663000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f2549d14000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f254343a000)
    libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f2543210000)
    libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f2542ffe000)
    libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f2542dfb000)
    libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f2542bf5000)
    libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f25429f3000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f25426b0000)
    libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f2542497000)
    libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f2542292000)
    libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f254208f000)
    libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f2541e8c000)
    libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f2541c85000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f2541a63000)
    libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f2541861000)
    libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f254165b000)
    libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f254144e000)
    libpulsecommon-5.0.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-5.0.so (0x00007f25411d4000)
    libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007f2540fcf000)
    libjson-c.so.2 => /lib/x86_64-linux-gnu/libjson-c.so.2 (0x00007f2540dc4000)
    libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f2540b7c000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f254090e000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f254070a000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f2540505000)
    libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f25402e8000)
    libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f25400e0000)
    libXtst.so.6 => /usr/lib/x86_64-linux-gnu/libXtst.so.6 (0x00007f253feda000)
    libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f253fcb6000)
    libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007f253faab000)
    libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007f253f842000)
    libasyncns.so.0 => /usr/lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007f253f63c000)
    libattr.so.1 => /lib/x86_64-linux-gnu/libattr.so.1 (0x00007f253f437000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f253f232000)
    libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f253f021000)
    liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f253edfe000)
    libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f253eb1d000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f253e906000)
    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f253e6ee000)
    libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007f253e4bb000)
    libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007f253e208000)
    libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f253dff6000)
    libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007f253dded000)
    libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007f253dbc1000)

    So I copied all the libaqmp files inside /opt/Qt/5.8/gcc_64/lib directory

    I made a new compilation.

    ldd SaborDelivery/SaborDelivery
    SaborDelivery/SaborDelivery: /opt/Qt/5.8/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by SaborDelivery/SaborDelivery)
    linux-vdso.so.1 (0x00007fff1d9c8000)
    libqamqp.so.0 => /opt/Qt/5.8/gcc_64/lib/libqamqp.so.0 (0x00007fd8a7ae6000)
    libQt5PrintSupport.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5PrintSupport.so.5 (0x00007fd8a7878000)
    libQt5Widgets.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Widgets.so.5 (0x00007fd8a7047000)
    libQt5Multimedia.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Multimedia.so.5 (0x00007fd8a6d3d000)
    libQt5Gui.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Gui.so.5 (0x00007fd8a65a2000)
    libQt5Sql.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Sql.so.5 (0x00007fd8a635b000)
    libQt5Xml.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Xml.so.5 (0x00007fd8a6121000)
    libQt5Network.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Network.so.5 (0x00007fd8a5d9b000)
    libQt5Core.so.5 => /opt/Qt/5.8/gcc_64/lib/libQt5Core.so.5 (0x00007fd8a567b000)
    libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007fd8a53e1000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8a51c4000)
    libpulse-mainloop-glib.so.0 => /usr/lib/x86_64-linux-gnu/libpulse-mainloop-glib.so.0 (0x00007fd8a4fbf000)
    libpulse.so.0 => /usr/lib/x86_64-linux-gnu/libpulse.so.0 (0x00007fd8a4d6e000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fd8a4a5f000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd8a4754000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd8a4453000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd8a423d000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8a3e92000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd8a3c77000)
    libicui18n.so.56 => /opt/Qt/5.8/gcc_64/lib/libicui18n.so.56 (0x00007fd8a37de000)
    libicuuc.so.56 => /opt/Qt/5.8/gcc_64/lib/libicuuc.so.56 (0x00007fd8a3426000)
    libicudata.so.56 => /opt/Qt/5.8/gcc_64/lib/libicudata.so.56 (0x00007fd8a1a43000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd8a183f000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd8a1637000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fd8a1435000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fd8a7d34000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fd8a120c000)
    libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007fd8a0fe2000)
    libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fd8a0dd0000)
    libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007fd8a0bcd000)
    libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007fd8a09c7000)
    libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007fd8a07c5000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fd8a0482000)
    libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007fd8a0269000)
    libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007fd8a0064000)
    libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007fd89fe61000)
    libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007fd89fc5e000)
    libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007fd89fa57000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fd89f835000)
    libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007fd89f633000)
    libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007fd89f42d000)
    libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007fd89f220000)
    libpulsecommon-5.0.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-5.0.so (0x00007fd89efa6000)
    libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007fd89eda1000)
    libjson-c.so.2 => /lib/x86_64-linux-gnu/libjson-c.so.2 (0x00007fd89eb96000)
    libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fd89e94e000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fd89e6e0000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fd89e4dc000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fd89e2d7000)
    libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007fd89e0ba000)
    libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007fd89deb2000)
    libXtst.so.6 => /usr/lib/x86_64-linux-gnu/libXtst.so.6 (0x00007fd89dcac000)
    libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fd89da88000)
    libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007fd89d87d000)
    libsndfile.so.1 => /usr/lib/x86_64-linux-gnu/libsndfile.so.1 (0x00007fd89d614000)
    libasyncns.so.0 => /usr/lib/x86_64-linux-gnu/libasyncns.so.0 (0x00007fd89d40e000)
    libattr.so.1 => /lib/x86_64-linux-gnu/libattr.so.1 (0x00007fd89d209000)
    libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fd89d004000)
    libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007fd89cdf3000)
    liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fd89cbd0000)
    libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fd89c8ef000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fd89c6d8000)
    libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fd89c4c0000)
    libFLAC.so.8 => /usr/lib/x86_64-linux-gnu/libFLAC.so.8 (0x00007fd89c28d000)
    libvorbisenc.so.2 => /usr/lib/x86_64-linux-gnu/libvorbisenc.so.2 (0x00007fd89bfda000)
    libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fd89bdc8000)
    libogg.so.0 => /usr/lib/x86_64-linux-gnu/libogg.so.0 (0x00007fd89bbbf000)
    libvorbis.so.0 => /usr/lib/x86_64-linux-gnu/libvorbis.so.0 (0x00007fd89b993000)

    and the deploy don´t work.



  • @Guapo said in QAMQP c++ ("forward declaration of class"):

    SaborDelivery...
    /mnt/midia4/prj/qt/build-SaborDelivery-Desktop_Qt_5_11_1_GCC_64bit-Debug/SaborDelivery: error while loading shared libraries: libqamqp.so.0: cannot open shared object file: No such file or directory

    So you seem to build a Debug version of your application but you try to use a non-debug version of the library?



  • Hi @sirop,

    The libqampq files was generated by CLI:
    qmake
    make

    So I created a libqamqp directory and put these files inside. Qt Creator don ´t link before LD_LIBRARY_PATH was updated. When the LD_LIBRARY_PATH point to my libamqp directory, QT Creator makes a debug and release version.

    But the deploy package is not working for this project, because a have another one that works. The difference between these 2 projects are this second uses this new shared lib.


  • Lifetime Qt Champion

    The linuxdeployqt project should be handy to help you deploy your application.



  • my compilation in linux is ok, but I need to make this compilation in windows too..

    In windows, I´m trying to compile the library qamqp.

    It stops at the linker because :

    C:/Qt/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lqamqp0

    I´m trying Qt Creator or CLI.

    In the Linux, I compiled this library and put the files at the lib directory and it´s possible to use this library.

    But in windows...

    There are a pri file:

    isEmpty(QAMQP_LIBRARY_TYPE) {
        QAMQP_LIBRARY_TYPE = shared
    }
    
    QT += network
    QAMQP_INCLUDEPATH = $${PWD}/src
    QAMQP_LIBS = -lqamqp
    CONFIG(debug, debug|release){
        QAMQP_LIBS = -lqamqpd
    }
    contains(QAMQP_LIBRARY_TYPE, staticlib) {
        DEFINES += QAMQP_STATIC
    } else {
        DEFINES += QAMQP_SHARED
        win32:QAMQP_LIBS = -lqamqp0
    }
    
    isEmpty(PREFIX) {
        unix {
            PREFIX = /usr
        } else {
            PREFIX = $$[QT_INSTALL_PREFIX]
        }
    }
    isEmpty(LIBDIR) {
        LIBDIR = lib
    }
    
    

    Thanks.


  • Lifetime Qt Champion

    Did you build that library on Windows ?



  • I´m trying to do this, but the process stop with "cannot find lqamqp0"

    First of all, I was unzip the qamqp project to build this library ( now in windows).



  • It seem that -lqmaqp0 is wrong.

    My compilation is ok and my app is running. I will publish all information to use this library before close this post.


  • Lifetime Qt Champion

    Do you mean that the library name was wrong ?


Log in to reply