C++ API with datatype with #pragma pack () causes exception

If I have a variable defined with #pragma pack (1), Matlab crashes with an exception as soon as I try to define the variable in the use the Matlab workspace via
testStruct = clib.<libraryName>.testStruct;
Without the #pragma it works just fine. Has anyone gotten this pragma to work? The existing C++ code I am working with has many of these pragmas so I would prefer to keep them as is if possible.
#pragma pack (1)
struct testStruct{
double a;
char c;
double b;
};

답변 (0개)

카테고리

도움말 센터File Exchange에서 Use Prebuilt MATLAB Interface to C/C++ Library에 대해 자세히 알아보기

태그

질문:

2021년 1월 11일

편집:

2021년 1월 11일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by