Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Adding Matlab C/C++ Library to Qt Desktop Application

$
0
0
Hi All, 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       += core gui   TARGET = seriously TEMPLATE = app     SOURCES += main.cpp\         mainwindow.cpp   HEADERS  += mainwindow.h   FORMS    += mainwindow.ui   win32-msvc2008: LIBS += -L"C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/lib/win32/microsoft/" -lmclmcrrt INCLUDEPATH += "C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/lib/win32/microsoft" DEPENDPATH += "C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/lib/win32/microsoft" win32: PRE_TARGETDEPS += "C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/lib/win32/microsoft/mclmcrrt.lib"   INCLUDEPATH += "C:/Program Files/MATLAB/MATLAB Compiler Runtime/v711/extern/include"   win32: LIBS += -L$$PWD/../../serious/src/ -lserious INCLUDEPATH += $$PWD/../../serious/src DEPENDPATH += $$PWD/../../serious/src win32: PRE_TARGETDEPS += $$PWD/../../serious/src/serious.lib In the code, serious.lib/dll is added as an external binary compiled by Matlab with VS2008 compiler. The Qt Windows libraries are used for compiling the project with VS2008 compiler. When I try to run the code, the application stops working and it gives me following result : exited with code -1073741819. Segmentation fault seems to be the issue. Thinking it might be an access violation, I ran Qt as an administrator but to no avail. I don’t understand where I am going wrong. Please help me with this problem. Thanks & Regards

Viewing all articles
Browse latest Browse all 18427

Trending Articles