﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5932	DLL needs to be in working directory	nnelsonwood@…	Adrian Pop	"I have been working on creating a library for internal use at my company and we need to have some functions written in C/C++ that interface with the Modelica code. 

After reading through the language specifications and some examples I was perfectly able to use the method where you just use the ''Include'' statement to add a ''.c'' file.

However, I had issues getting the exact same file to work when compiled into a ''.dll''. It would compile just fine, but I would get the following error during the simulation step:

{{{
Process crashed
Simulation process failed. Exited with code -1073741515.
}}}

The ''.h'' file is in ''LibraryName/External/Resources/Include'' and the ''.dll'' is in ''LibraryName/External/Resources/Library/win64''. The code block for the external function is as follows:

{{{
  function External_Lib ""External function in a library to generate signal""
    input Real t;
    output Real x;
  
    external ""C"" x = External_Lib(t) annotation(
      LibraryDirectory = ""modelica://LibraryName/External/Resources/Library"",
      Library = ""External_Lib"",
      IncludeDirectory = ""modelica://LibraryName/External/Resources/Include"",
      Include = ""#include \""External_Lib.h\"""");
  end External_Lib;
}}}

After trying many different things I found that it will work if I also put the ''.dll'' in the working directory of OMEdit. My guess is that the issue is either that found libraries are not properly added to the PATH, or that the DLL dependencies are not properly being included."	defect	accepted	high		Run-time	v1.14.0		dll, external, C, C++	
