将错误作为 void * 无法分配给 char* 16 类型的实体应该做什么才能解决错误。问题存在于 xmlpath 和 dllPath
void fmuLoad() {
char* fmuPath;
char tmpPath[1000]="W:\\Prajwal\\GM_FMU_EXTRACT\\";
char* xmlPath;
char* dllPath;
const char *modelId;
FMU fmu;
fmuUnzip();
// parse tmpPath\modelDescription.xml
xmlPath = calloc(sizeof(char), strlen(tmpPath) + strlen(XML_FILE) + 1);
sprintf(xmlPath, "%s%s", tmpPath, XML_FILE);
fmu.modelDescription = parse(xmlPath);
free(xmlPath);
if (!fmu.modelDescription) exit(EXIT_FAILURE);
//printf(fmu.modelDescription);
#ifdef FMI_COSIMULATION
modelId = getAttributeValue((Element*)getCoSimulation(fmu.modelDescription),att_modelIdentifier);
//#else // FMI_MODEL_EXCHANGE
// modelId = getAttributeValue((Element *)getModelExchange(fmu.modelDescription), att_modelIdentifier);
#endif
// load the FMU dll
dllPath = calloc(sizeof(char), strlen(tmpPath) + strlen(DLL_DIR) + strlen(modelId) + strlen(".dll") + 1);
sprintf(dllPath, "%s%s%s.dll", tmpPath, DLL_DIR, modelId);
if (!loadDll(dllPath, &fmu)) {
exit(EXIT_FAILURE);
}
// free(dllPath);
// free(fmuPath);
// free(tmpPath);
}