QT how to use libssh2



  • Development environment:Qt Creator +mingw + windows7+libssh2(build from VS2010)
    libssh2 build environment:VS2010+zlib1.2.8+openssl1.0.1h+libssh2-1.4.3

    D:\qtObject\libssh2-1.4.3\include\libssh2.h:88: error: expected unqualified-id before string constant
    extern "C" {

    D:\Qt\Qt5.3.1\Tools\mingw482_32\i686-w64-mingw32\include\excpt.h:11: error: expected '}' before end of line
    #pragma pack(push,_CRT_PACKING)

    D:\Qt\Qt5.3.1\Tools\mingw482_32\i686-w64-mingw32\include\excpt.h:-1: At global scope:

    D:\Qt\Qt5.3.1\Tools\mingw482_32\i686-w64-mingw32\include\excpt.h:11: error: expected declaration before end of line

    I am a C + + beginners
    I do not know how to fix this error
    Please help me

    !http://img.bbs.csdn.net/upload/201407/11/1405075928_137857.png(QT error)!



  • It looks like (guessing) that you have put
    @
    #include "libssh2.h"
    @
    Inside a function ( main() perhaps) at line 77 of main.cpp rather than outside. Hard to be sure without seeing the code.



  • @ChrisW67,thanks
    I am sorry,It was my fault
    I included libssh2 header file in the main function led to this error


Log in to reply
 

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