Some structures not being created properly from header files when using libstruct
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, I’m having issues with the libstruct function for certain types of structures in some shared libraries I’m working with. The structures are defined in a couple of ways in the header file. I’m not familiar enough with C to know the difference between these.
Type 1
typedef struct
{
int value1;
short value2;
}typeName;
Type 2
typedef struct _typeName{
int value1;
short value2;
}typeName;
Structures that have _typeName before the contents of the structure are specified don't seem to work.
Structures that are defined in the first form work fine with libstruct, those defined in the second way give me an error that says “Undefined function or variable ‘lib.typeName’”
I've tried creating the libstructs in two ways, with and without pre-creating an associated matlab structure.
myStruct=libstruct('typedef');
and also by first creating myStructML
myStructML.value1 = 0; myStructML.value2 = 0;
myStruct=libstruct('typedef', myStructML);
I get the same error for the structs that appear in the header file in the Type 2 format in both cases.I'm using 2019b on Windows 10.
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Environment and Settings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!