Results 1 to 2 of 2

Thread: Unable to deploy Matlab Built C LIbrary onto Qt Platform

  1. #1
    Join Date
    Dec 2012
    Posts
    17
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Unable to deploy Matlab Built C LIbrary onto Qt Platform

    Hi

    I have started working on Qt very recently and have been able something by following this forum. I basically work on signal processing algorithms. I have created a C shared library using the Matlab C Compiler. I wanted it to be integrated to my Qt Project.

    Before adding the library, I first created a standalone C Executable, to see if the code runs. It does. I get Matlab Plots as well. Everything all right till here. But that's not what i want. I need to change the parameters on from the Qt. Hence, the need for the library.

    Since I am very new in it, I followed the forums and blogs to get it done. This is essentially what i followed.

    http://michael-stengel.com/blog/?p=89


    My Project file looks something like this

    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2013-01-18T18:12:26
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core gui
    8.  
    9. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    10.  
    11. TARGET = bingshing
    12. TEMPLATE = app
    13.  
    14.  
    15. SOURCES += main.cpp\
    16. mainwindow.cpp \
    17. ../../../projectsarson/src/projectsarson.c \
    18. ../../../projectsarson/src/projectsarson_mcc_component_data.c
    19.  
    20. HEADERS += mainwindow.h \
    21. ../../../projectsarson/src/projectsarson.h \
    22.  
    23. FORMS += mainwindow.ui
    24.  
    25.  
    26. unix|win32-msvc2010: LIBS += -L"C:/Program Files (x86)/MATLAB/MATLAB Compiler Runtime/v78/extern/lib/win32/microsoft/" -lmclmcrrt
    27.  
    28. INCLUDEPATH += "C:/Program Files (x86)/MATLAB/MATLAB Compiler Runtime/v78/extern/lib/win32/microsoft"
    29. DEPENDPATH += "C:/Program Files (x86)/MATLAB/MATLAB Compiler Runtime/v78/extern/lib/win32/microsoft"
    30. INCLUDEPATH += "C:/Program Files (x86)/MATLAB/MATLAB Compiler Runtime/v78/extern/include"
    31. DEPENDPATH += "C:/Program Files (x86)/MATLAB/MATLAB Compiler Runtime/v78/extern/include"
    32. win32: PRE_TARGETDEPS += "C:/Program Files (x86)/MATLAB/MATLAB Compiler Runtime/v78/extern/lib/win32/microsoft/mclmcrrt.lib"
    33. else:unix: PRE_TARGETDEPS += "C:/Program Files (x86)/MATLAB/MATLAB Compiler Runtime/v78/extern/lib/win32/microsoft/libmclmcrrt.a"
    34. #LIBS += "C:/Program Files (x86)/MATLAB/MATLAB Compiler Runtime/v78/extern/lib/win32/microsoft" -llibeng -llibmat -llibmx
    35.  
    36. win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../projectsarson/src/ -lprojectsarson
    37. else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../projectsarson/src/ -lprojectsarson
    38. else:unix: LIBS += -L$$PWD/../../../projectsarson/src/ -lprojectsarson
    39.  
    40. INCLUDEPATH += $$PWD/../../../projectsarson/src
    41. DEPENDPATH += $$PWD/../../../projectsarson/src
    42.  
    43. win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../../projectsarson/src/projectsarson.lib
    44. else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../../projectsarson/src/projectsarson.lib
    45. else:unix: PRE_TARGETDEPS += $$PWD/../../../projectsarson/src/libprojectsarson.a
    46.  
    47. OTHER_FILES += \
    48. ../../../projectsarson/src/projectsarson.exp \
    To copy to clipboard, switch view to plain text mode 

    When I try to run the code, the application stops working and it gives me following result : exited with code -1073741819


    I tried to search in the forum and found that it might be an access violation. I ran qt as an administrator. Still the same

    I don't understand where I am going wrong.

    Please Please help me with this problem

    Thanks & Regards

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Unable to deploy Matlab Built C LIbrary onto Qt Platform

    Where does this segmentation fault happen? I mean in the library?, or the interface code?

    Try building the library in debug mode and debug it from Qt code.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. The following user says thank you to Santosh Reddy for this useful post:

    alok9871 (28th January 2013)

Similar Threads

  1. Replies: 1
    Last Post: 20th June 2012, 09:53
  2. Use your own built library?!
    By ranzani in forum Qt Programming
    Replies: 5
    Last Post: 21st June 2011, 11:02
  3. Deploy a Library
    By cafu1007 in forum Qt Programming
    Replies: 30
    Last Post: 31st August 2010, 18:02
  4. Qt visual studio errors before compiling / deploy on Windows Mobile platform
    By boblatino in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 23rd July 2010, 02:38
  5. How to deploy QT with matlab?
    By amagdy.ibrahim in forum Installation and Deployment
    Replies: 6
    Last Post: 3rd July 2008, 15:17

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.