Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. trying to open .so with QLibrary

trying to open .so with QLibrary

Scheduled Pinned Locked Moved Unsolved Language Bindings
qlibraryopen .so
2 Posts 2 Posters 1.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    quinroux
    wrote on last edited by
    #1

    hello,
    i'm trying to open a .so (i made it in c++) with QLibrary, i've been trying many option but nothing seems to work
    here is my class witch use QLibrary

    .cpp

    UpdateWindows::UpdateWindows()
    {
        ruleName = new QLineEdit;
        statement = new QLineEdit;
        value = new QLineEdit;
        updateButton = new QPushButton("Update Rule");
    
        QObject::connect(updateButton, SIGNAL(clicked()), this, SLOT(update()));
    
        layout = new QFormLayout;
        layout->addRow("Rule Name", ruleName);
        layout->addRow("Statement", statement);
        layout->addRow("Value", value);
        layout->addWidget(updateButton);
    
        this->setLayout(layout);
    }
    
    void UpdateWindows::update(){
        QLibrary myLib("libWESTGARD-SSM") ;
        typedef EUpdateResult (*MyPrototype)(bool);
            MyPrototype resultUpdate =(MyPrototype) myLib.resolve("updateEvaluateParameterizableRulesIf1_2sSucceed");
            if(resultUpdate){
                EUpdateResult Eur = resultUpdate(false);
                if(Eur == UPDATE_OK){
                    QMessageBox msgBox;
                    msgBox.setText("Eur update ok");
                    msgBox.exec();
                }
            }else{
                QMessageBox msgBox;
                msgBox.setText("fonction failed");
                msgBox.exec();
            }
    }
    

    i also tried to add a library inside the .pro

    QT += widgets
    
    
    SOURCES += \
        main.cpp \
        mainwindows.cpp \
        evaluationwindows.cpp \
        updatewindows.cpp \
        configwindows.cpp
    
    HEADERS += \
        mainwindows.h \
        evaluationwindows.h \
        EUpdateResult.h \
        updatewindows.h \
        configwindows.h
    
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Westgard-SSM/lib/release/ -lWESTGARD-SSM
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Westgard-SSM/lib/debug/ -lWESTGARD-SSM
    else:unix: LIBS += -L$$PWD/Westgard-SSM/lib/ -lWESTGARD-SSM
    
    INCLUDEPATH += $$PWD/Westgard-SSM/lib
    DEPENDPATH += $$PWD/Westgard-SSM/lib
    
    

    but doesn't work as well

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you sure you library can be found ?

      What version of Qt are you using ?
      On what platform ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved