I am creating a DLL using auto generated code.
There can only be one entry point function to the DLL. But in turn the entry point function should call other functions internally.
There is a structure object declared and defined as a global variable. But when i try to use the structure in my entry point function the DLL crashes.
How can i use the global struct objects in entry point and other internal functions? I tried to multiple ways, but none of them seem to work.
(this is the global declaration - i dothis is a Wrapper.h file)
RT_MODEL_TestDLL TestDLL_M_; // RT_MODEL_TestDLL is a struct
RT_MODEL_TestDLL *TestDLL_M = &TestDLL_M_;
(In Wrapper.cpp i call the following autogenerated function)
void MdlInitializeSizes(void)
{
TestDLL_M->Sizes.numContStates = (0);/* Number of continuous states */
TestDLL_M->Sizes.numY = (1); /* Number of model outputs */
TestDLL_M->Sizes.numU = (1); /* Number of model inputs */
TestDLL_M->Sizes.sysDirFeedThru = (1);/* The model is direct feedthrough */
TestDLL_M->Sizes.numSampTimes = (1); /* Number of sample times */
TestDLL_M->Sizes.numBlocks = (2); /* Number of blocks */
TestDLL_M->Sizes.numBlockIO = (0); /* Number of block outputs */
TestDLL_M->Sizes.numBlockPrms = (1); /* Sum of parameter "widths" */
}