Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Help : Segmentation fault when using a 3rd library

Help : Segmentation fault when using a 3rd library

Scheduled Pinned Locked Moved 3rd Party Software
4 Posts 3 Posters 1.4k Views
  • 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.
  • T Offline
    T Offline
    Tissues
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      Tissues
      wrote on last edited by
      #2

      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?

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

        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/

        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
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #4

          closing this duplicate here

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0

          • Login

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