﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2657	Include annotation still ignored when using functions defined outside package	Francesco Casella	Adrian Pop	"After ticket #2412 was fixed, all the test cases in ExternalMedia started to work properly, without any need of copying the .h and .lib files to the OMC installation directories.

However, all those test cases use medium packages which are defined within the very same package that contains the Resource directory (i.e., ExternalMedia itself).

In practice, only a finite number of actual package media can be defined in ExternalMedia. Any end user will eventually need to define his/her own media outside of the library (which he/she can use but not modify as an end user). If you do so, the problem is still there. Try these simple examples:

{{{
package TestExternalMediaDefinition
  package WaterIF95 ""RefProp water model""
    extends ExternalMedia.Media.FluidPropMedium(
      mediumName = ""Water"", 
      libraryName = ""FluidProp.RefProp"", 
      substanceNames = {""H2O""});
  end WaterIF95;

  model Test1
    package Medium = WaterIF95;
    Medium.Density d = Medium.density_pT(100000.0, 300);
  end Test1;

  model Test2
    package Medium = 
      ExternalMedia.Media.FluidPropMedium(
        mediumName = ""Water"", 
        libraryName = ""FluidProp.RefProp"",
        substanceNames = {""H2O""});
    Medium.Density d = Medium.density_pT(100000.0, 300);
  end Test2;
end TestExternalMediaDefinition;
}}}

In both cases, when I compile in OMC I get
{{{
error: externalmedialib.h: No such file or directory
}}}

You need to make sure that the path of the package where the external function is defined is used for C-code generation, not the one of the package where the medium is eventually declared. "	defect	closed	high	1.9.1	Frontend	trunk	fixed		
