modelica-3rdparty / msgpack-modelica

A MessagePack implementation as a Modelica package
BSD 2-Clause "Simplified" License
6 stars 4 forks source link

Include ModelicaUtilities.h as C #5

Closed tbeu closed 10 years ago

tbeu commented 10 years ago

Otherwise the MSVC linker complains with

msgpack-modelica.obj : error LNK2019: unresolved external symbol "void __cdecl ModelicaFormatError(char const *,...)" (?ModelicaFormatError@@YAXPBDZZ) referenced in function _msgpack_modelica_sbuffer_to_file
msgpack-modelica.obj : error LNK2019: unresolved external symbol "void __cdecl ModelicaError(char const *)" (?ModelicaError@@YAXPBD@Z) referenced in function _msgpack_modelica_unpack_int
msgpack-modelica.obj : error LNK2019: unresolved external symbol "char * __cdecl ModelicaAllocateString(unsigned int)" (?ModelicaAllocateString@@YAPADI@Z) referenced in function _msgpack_modelica_unpack_string
sjoelund commented 10 years ago

I guess this should go into ModelicaUtilitites.h instead?

tbeu commented 10 years ago

Not sure where to fix. Maybe MA people assume it is always inlcuded and linked as C header. But for ModelicaStandardTables.c I needed to to the same.

sjoelund commented 10 years ago

You should try to never do extern "C" before you include a header, because if that header includes C++ headers, extern "C" conflicts. I'll fix it in ModelicaUtilities.h. That seems safer anyway.

tbeu commented 10 years ago

Then you can also fix it in ModelicaStandardTables.c. Thanks!

tbeu commented 10 years ago

... and ModelicaMatIO.h.

sjoelund commented 10 years ago

https://trac.modelica.org/Modelica/changeset/7486 should fix it

tbeu commented 10 years ago

I propose to add it also to the MSL 3.2.1 maintenance branch.

sjoelund commented 10 years ago

Done