Help : Segmentation fault when using a 3rd library



  • I am a windows user and new to Qt with mingw32. Now I'm trying to use a library 'smile' (which builds up a bayesian network and then do references), I have put everything including .a file and .h file in the root directory and added them in the .pro file (though I don't know whether I have done it right):
    @QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = trysmile
    TEMPLATE = app

    SOURCES += main.cpp
    widget.cpp
    buildnetwork.cpp
    filecommu.cpp
    inference.cpp
    para_learn.cpp
    stru_learn.cpp

    HEADERS += widget.h
    libheader.h

    FORMS += widget.ui

    DEFINES += NDEBUG

    QMAKE_CFLAGS_RELEASE -= -O2
    QMAKE_CFLAGS_RELEASE += -O3
    QMAKE_CFLAGS_RELEASE += -ffast-math
    QMAKE_CXXFLAGS_RELEASE -= -O2
    QMAKE_CXXFLAGS_RELEASE += -O3
    QMAKE_CXXFLAGS_RELEASE += -ffast-math
    QMAKE_CFLAGS_DEBUG -= -O2
    QMAKE_CFLAGS_DEBUG += -O3
    QMAKE_CFLAGS_DEBUG += -ffast-math
    QMAKE_CXXFLAGS_DEBUG -= -O2
    QMAKE_CXXFLAGS_DEBUG += -O3
    QMAKE_CXXFLAGS_DEBUG += -ffast-math

    LIBS += -L$$PWD/ -lsmile
    PRE_TARGETDEPS += $$PWD/libsmile.a
    LIBS += -L$$PWD/ -lsmilearn
    PRE_TARGETDEPS += $$PWD/libsmilearn.a
    INCLUDEPATH += $$PWD/
    DEPENDPATH += $$PWD/
    @
    I included "smile.h" and was trying to run a tutorial program, but I received a signal 'SIGSEGV' when trying to declare a new variable.

    BTW the compiler tells me that there are many unused parameters in my program. Is it normal for a well-included library?



  • One more thing, I saw an instruction on the smile website:

    Distributions built with gcc use the following compiler switches:
    -O3 -DNDEBUG -ffast-math

    Does anyone know how to add these codes?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Please don't post the same thread in multiple sub-forums, one is enough

    "Duplicate":http://qt-project.org/forums/viewthread/37473/


  • Moderators

    closing this duplicate here


Log in to reply
 

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