﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1088	Constructor for an external object without (input) argument	krsta	krsta	"Dear Developers,

I wanted to report my finding that OpenModelica does not seem to be capable of handling a constructor for an external object that does not have an (input) argument.

Not sure if this is a bug or not.

Regards,

Beat Arnet

{{{
package ExtObj
  class CGlobals
      extends ExternalObject;
    function constructor
      output CGlobals cg;

      external ""C"" cg=initCGlobals() ;
      annotation(Include=""#include
\""../src/include.h\"""",Library=""ExtLib.lib"");
    end constructor;
 
    function destructor
          input CGlobals cg;

      external ""C"" closeCGlobals(cg) ;
      annotation(Include=""#include
\""../src/include.h\"""",Library=""ExtLib.lib"");
    end destructor;
  end CGlobals;
 
  model ExtObjtest
    CGlobals cg=CGlobals();
    Real y;
  equation
    y=testCGlobals(cg);
  end ExtObjtest;
 
  function testCGlobals
    input CGlobals cg;
    output Real y;

    external ""C"" y=testCGlobals(cg) ;
  end testCGlobals;
end ExtObj;


model testextobj
  ExtObj.ExtObjtest t;
end testextobj;


record
    resultFile = ""Simulation failed.
No matching function found for CGlobals() of type function() => ExtObj.CGlobals ExternalObject, candidates are function() => ExtObj.CGlobals ExternalObject Error occured while flattening model testextobj ""
end record
}}}"	defect	closed	high				fixed		krsta
