﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4675	Statically link libstdc++ on Windows	simon.zeni@…	Adrian Pop	"Hi,

For my work I need to load an FMU in Matlab from a C++ S-Function. The FMU in question is a shared library (DLL) zipped in an archive with all the dependencies generated by the compilation.

The code is compiled from OMScript with the following line :

{{{
translateModelFMU('FMU', version=""1.0"")
}}}

The code generation and compilation goes without any problem. The trouble comes at the loading of the shared library.

On Windows, Matlab is already loading libstdc++-6.dll, but a different version from the one provided with the FMU.

With a debugger, I was able to get this information 
{{{
LdrpSnapThunk - ERROR: Procedure ""_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcyy"" could not be located in DLL ""libstdc++-6.dll""
Exception thrown at 0x0000000077358078 (ntdll.dll) in MATLAB.exe: 0xC0000139: Entry Point Not Found.
}}}

One possible solution would be to link statically libstdc++ to avoid this DLL collision.

Unfortunately I spent hours going through the documentation to find a way to do such, but every attempt ended up with exactly the same result as I initially get.

This is currently blocking us to go any further in our upgrade of OpenModelica.

I can provide more informations and clarifications if needed.

Thanks."	defect	closed	blocker	1.13.0	FMI	v1.12.0	fixed	static linking libstdc++	
