Hi,
This model turns correctly under Dymola and not under OpenModelica
model PreBug
Integer x(start=4,fixed=true);
equation
if time >0.1 and pre(x)== 10 then
x=pre(x)-1;
else
x=4;
end if;
end PreBug;
Note that if we change the if condition by (if time >0.1 and
pre(x)== 4) the simulation will stop at time =0.1 under Dymola. This is
du to the restart condition.
It is clear that the condition pre(x)==10 is never crossed.. but this haven't
to stop generating C code by the compiler.
This is the error message generated:
g++ -I"C:\OpenModelica1.5.0\/include/omc" -msse2 -mfpmath=sse -I. -o
PreBug.exe PreBug.cpp -L"D:/omcSpecial/PortageWiebe" -lsim
-L"C:\OpenModelica1.5.0\/lib/omc" -lc_runtime -lf2c -linteractive -lsendData
-lQtNetwork-mingw -lQtCore-mingw -lQtGui-mingw -luuid -lole32 -lws2_32
PreBug.cpp: In function `int function_updateDependents()':
PreBug.cpp:563: error: no matching function for call to `pre(double)'
C:/OpenModelica1.5.0//include/omc/simulation_events.h:59: note: candidates are:
double pre(double&)
C:/OpenModelica1.5.0//include/omc/simulation_events.h:60: note:
char* pre(char*&)
PreBug.cpp: In function `int function_updateDepend()':
PreBug.cpp:596: error: no matching function for call to `pre(double)'
C:/OpenModelica1.5.0//include/omc/simulation_events.h:59: note: candidates are:
double pre(double&)
C:/OpenModelica1.5.0//include/omc/simulation_events.h:60: note:
char* pre(char*&)
mingw32-make: *** [PreBug] Error 1
Any idea? Thank you!!
Regards,Hassen