Problem in use libssh (application crashed)



  • Hello friends ,
    I want to use libssh library. I first downloaded version 0.7.2 of the library
    0_1504956321206_e09c2514-a4f5-4e1a-9cbb-3460443d9434-image.png
    And I opened a new project in Qt, And is included in .pro

    QT       += core gui network
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = untitled
    TEMPLATE = app
    DEFINES += QT_DEPRECATED_WARNINGS
    # Libssh:
    LIBS += -L$$PWD'/libssh/lib/' -lssh
    INCLUDEPATH += $$PWD'/libssh/include/'
    SOURCES += main.cpp\
            mainwindow.cpp
    HEADERS  += mainwindow.h
    FORMS    += mainwindow.ui
    

    And finally, I used a simple example ...
    But the program is crashed .
    0_1504900900304_f4e15fe6-9cc9-49c5-88ad-a3d4078b6a47-image.png
    where is the problem?
    tnx :x


  • Lifetime Qt Champion

    Hi,

    Might be unrelated but why do you have the MinGW version of that library highlighted while you are building for Visual Studio 2015 ?

    In any case, where are the .dlls located ?



  • @SGaist said in Problem in use libssh (application crashed):

    Hi,
    Might be unrelated but why do you have the MinGW version of that library highlighted while you are building for Visual Studio 2015 ?
    In any case, where are the .dlls located ?
    thanks for your response ,
    Because of the absence of WebEngine in the MinGW compiler, I use the msvc compiler.

    Dll,Lib Libssh Locate :

    0_1504948390878_d5272f84-cd3d-4230-88a5-7b23f7fbca01-image.png


  • Qt Champions 2017

    Hi
    Unless you downloaded some other packets named
    -msvc in the end, you are mixing compilers.



  • No, I downloaded the msvc version


  • Qt Champions 2017

    @MrErfan
    Super. And that VS compiled DLL are compatible with
    vs 2015 ?



  • I do not know, I just downloaded libssh from here And I used it in my project


  • Qt Champions 2017

    @MrErfan
    Ok. i also tried to look at site but its not clear what VS was used.
    It looks like a c api so not sure how compatible the dlls are.
    When c++ Api, its very sensitive.

    If you have cmake installed, then maybe just build it your self to be
    sure ?

    Did you single step the application?
    Do you know if it crashes before main or first when you
    use it in main ?
    (the my_ssh_session stuff)


  • Lifetime Qt Champion

    Then you have to go to the "Run" part of the Project panel. Once there, modify the PATH environment variable and prepend the folder where the ssh.dll file can be found. Do NOT do it system wide.

    Other solution is to copy the ssh.dll in the build folder of your application.



  • Thank you, the problem has been resolved.


Log in to reply
 

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