﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4772	Problems with Cpp runtime under Win32	Rüdiger Franke	Martin Sjölund	"The following model simulates and can be exported as FMU with the Cpp runtime under Linux.

{{{#!mo
model TableTest
  extends Modelica.Blocks.Tables.CombiTable2D(
      table = [0.0,   1.0,   2.0,   3.0;
               1.0,   1.0,   3.0,   5.0;
               2.0,   2.0,   4.0,   6.0]);
  annotation(uses(Modelica(version=""3.2.2"")));
end TableTest;
}}}

The 32bit Windows release of OpenModelica produces the following errors:

1. Simulation from OMEdit stops with the error message: 
{{{
 simulation manager: Simulation failed for C:/Users/Someone/AppData/Local/Temp/OpenModelica/OMEdit/TableTest/TableTest_res.mat with error in simulation manager:
Could not initialize system
Could not read start values. Current variable reference is 1
}}}

2. FMI export from OMEdit raises linker errors:
{{{
C:/OpenModelica1.13.0-dev-32bit//lib//omc\libModelicaIO.a(ModelicaIO.o): In function `readMatIO': 
C:\dev\OpenModelica32bit\OMCompiler\3rdParty\ModelicaExternalC\BuildProjects\autotools/../../C-Sources/ModelicaIO.c:446: undefined reference to `Mat_Open' 
C:\dev\OpenModelica32bit\OMCompiler\3rdParty\ModelicaExternalC\BuildProjects\autotools/../../C-Sources/ModelicaIO.c:455: undefined reference to `Mat_VarReadInfo' 
...
}}}

It appears that `EXTRA_LIBS` that is initialized during code generation from `makefileParams.libs` has the wrong order:
  `-lModelicaStandardTables -lModelicaIO -lModelicaMatIO -lzlib`
The linker error disappears with:
  `-lModelicaIO -lModelicaMatIO -lModelicaStandardTables`

Btw. why do you link `-lzlib` to the FMU?

Moreover, `-lModelicaStandardTables` also finds in `c:/OpenModelica1.13.0-dev-32bit/lib/omc/cpp`. Should this possibly be removed and taken from Modelica 3.2.2 Resources instead?"	defect	closed	normal	1.13.0	Build Environment		fixed		Niklas Worschech Adrian Pop
