Creating a QApplication with Matlab Engine
Show older comments
I'm trying to create a qt application with matlab engine. The program is throwing Segmentation fault when it tires to create a QApplication object. Following is the sample code that seg faults.
#include <QApplication>
int main(int argc, char **argv)
{
QApplication application(argc, argv);
return 0;
}
Following is the CMakeLists.txt that goes along with this.
cmake_minimum_required(VERSION 3.4)
find_package(Qt5Widgets)
find_package(Matlab REQUIRED COMPONENTS ENG_LIBRARY MX_LIBRARY)
include_directories(${Matlab_INCLUDE_DIRS})
add_executable( example main.cpp)
target_link_libraries(example ${Matlab_LIBRARIES} Qt5::Widgets )
I tried compiling against 2017a and 2018a, but no luck.
Any help would be much appreciated.
Answers (0)
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!