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. Problems linking Matlab libraries into Qt (Linux) .. libeng.so: undefined reference to ..
QtWS25 Last Chance

Problems linking Matlab libraries into Qt (Linux) .. libeng.so: undefined reference to ..

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
7 Posts 2 Posters 3.2k 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.
  • eduardo_parraE Offline
    eduardo_parraE Offline
    eduardo_parra
    wrote on last edited by eduardo_parra
    #1

    Hey
    I want to create a program that has a user interface for inputs and outputs that is created using Qt c++ IDE and back functions that are programmed using matlab.
    To do that im using MATLAB Engine library in GUI code, but im having problems to link the Matlab libraries.
    My code of the .pro file is:

    TEMPLATE = app
    CONFIG += console
    CONFIG -= app_bundle
    CONFIG -= qt
    SOURCES += main.c
    include(deployment.pri)
    qtcAddDeployment()
    INCLUDEPATH += $$PWD/../../../MATLAB/R2016a/extern/include
    INCLUDEPATH += $$PWD/../../../MATLAB/R2016a/bin/glnxa64
    DEPENDPATH += $$PWD/../../../MATLAB/R2016a/bin/glnxa64
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../MATLAB/R2016a/bin/glnxa64/release/
    -lmex
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../MATLAB/R2016a/bin/glnxa64
    /debug/ -lmex
    else:unix: LIBS += -L$$PWD/../../../MATLAB/R2016a/bin/glnxa64/ -lmex
    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../MATLAB/R2016a/bin/glnxa64/release/
    -leng
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../MATLAB/R2016a/bin/glnxa64
    /debug/ -leng
    else:unix: LIBS += -L$$PWD/../../../MATLAB/R2016a/bin/glnxa64/ -leng
    

    The compile output is as follows:

    14:50:27: Running steps for project untitled...
    14:50:27: Configuration unchanged, skipping qmake step.
    14:50:27: Starting: "/usr/bin/make" 
    g++ -Wl,-rpath,/home/tecnobit/Qt5.5.0/5.5/gcc_64 -o untitled main.o   -L/home/user/desktop/untitled
    /../../../MATLAB/R2016a/bin/glnxa64/ -lmex -leng 
    /usr/bin/ld: warning: libut.so, needed by /home/user/desktop/untitled/../../../MATLAB/R2016a
    /bin/glnxa64//libeng.so, not found (try using -rpath or -rpath-link)
    /usr/bin/ld: warning: libmx.so, needed by /home/user/desktop/untitled/../../../MATLAB/R2016a
    /bin/glnxa64//libeng.so, not found (try using -rpath or -rpath-link)
    /usr/bin/ld: warning: libmat.so, needed by /home/user/desktop/untitled/../../../MATLAB/R2016a
    /bin/glnxa64//libeng.so, not found (try using -rpath or -rpath-link)
    /usr/bin/ld: warning: libboost_system.so.1.56.0, needed by /home/user/desktop/untitled/../../../MATLAB
    /R2016a/bin/glnxa64//libeng.so, not found (try using -rpath or -rpath-link)
    /usr/bin/ld: warning: libmwcpp11compat.so, needed by /home/user/desktop/untitled/../../../MATLAB
    /R2016a/bin/glnxa64//libeng.so, not found (try using -rpath or -rpath-link)
    /home/user/desktop/untitled/../../../MATLAB/R2016a/bin/glnxa64//libeng.so: undefined reference to 
    `utF2cstr'
    /home/user/desktop/untitled/../../../MATLAB/R2016a/bin/glnxa64//libeng.so: undefined reference to 
    `utFree'
    /home/user/desktop/untitled/../../../MATLAB/R2016a/bin/glnxa64//libeng.so: undefined reference to 
    `matClose'
    /home/user/desktop/untitled/../../../MATLAB/R2016a/bin/glnxa64//libeng.so: undefined reference to 
    `matPutNextVariable'
    /home/user/desktop/untitled/../../../MATLAB/R2016a/bin/glnxa64//libeng.so: undefined reference to 
    `matCreateMATFile'
    /home/user/desktop/untitled/../../../MATLAB/R2016a/bin/glnxa64//libeng.so: undefined reference to 
    `matrix::detail::noninlined::mx_array_api::mxDestroyArray(mxArray_tag*)'
    /home/user/desktop/untitled/../../../MATLAB/R2016a/bin/glnxa64//libeng.so: undefined reference to 
    `matGetNextVariable'
    /home/user/desktop/untitled/../../../MATLAB/R2016a/bin/glnxa64//libeng.so: undefined reference to 
    `utCalloc'
    collect2: error: ld returned 1 exit status
    make: *** [untitled] Error 1
    14:50:27: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project untitled (kit: Desktop Qt 5.5.0 GCC 64bit)
    When executing step "Make"
    14:50:27: Elapsed time: 00:00.
    

    Everything that i found in google couldn't help, can somebody help me i've got really no idea what to do...

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      The warning messages seem pretty clear - you need to add -L and -l paths to libut.so, libmx.so, libmat.so, boost, etc. Or install them in your system.

      (Z(:^

      eduardo_parraE 1 Reply Last reply
      0
      • sierdzioS sierdzio

        The warning messages seem pretty clear - you need to add -L and -l paths to libut.so, libmx.so, libmat.so, boost, etc. Or install them in your system.

        eduardo_parraE Offline
        eduardo_parraE Offline
        eduardo_parra
        wrote on last edited by
        #3

        @sierdzio Thank you for answer. I have already try that, but i can't add 'libboost_system.so.1.56.0' library as it does not finish with .so. Any idea?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Install it in your system, then:

          sudo apt-get install libboost1.56-dev
          

          In newest Ubutu the lib is actually 1.58, but maybe they are compatible. Once it is installed in the system, you don't need to add it to your LIBS in the .pro file - it will be linked automatically.

          (Z(:^

          eduardo_parraE 1 Reply Last reply
          0
          • sierdzioS sierdzio

            Install it in your system, then:

            sudo apt-get install libboost1.56-dev
            

            In newest Ubutu the lib is actually 1.58, but maybe they are compatible. Once it is installed in the system, you don't need to add it to your LIBS in the .pro file - it will be linked automatically.

            eduardo_parraE Offline
            eduardo_parraE Offline
            eduardo_parra
            wrote on last edited by eduardo_parra
            #5

            @sierdzio I have tried to install it, unfortunately it cant be located. I can install the previous version : libboost1.55-dev, but it does not solve the problem. I have already tried upgrade and update before the install. Should i use a newer version of Ubuntu? My current version is 14.04.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Try here, then: http://packages.ubuntu.com/wily/amd64/libboost1.58-all-dev/download

              Or compile boost from source.

              (Z(:^

              eduardo_parraE 1 Reply Last reply
              0
              • sierdzioS sierdzio

                Try here, then: http://packages.ubuntu.com/wily/amd64/libboost1.58-all-dev/download

                Or compile boost from source.

                eduardo_parraE Offline
                eduardo_parraE Offline
                eduardo_parra
                wrote on last edited by
                #7

                @sierdzio Im having a lot of problems to install it because of the dependencies with other libraries

                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