[Mono-dev] mono_config_parse won't link, needs extern "C" declaration in header file

Andreas Färber andreas.faerber at web.de
Thu Apr 3 03:09:32 EDT 2008


Am 02.04.2008 um 22:40 schrieb Sebastian Good:

> It seems to me that adding G_{BEGIN/END}_DECLS to mono-config.h  
> requires a recompile because it causes the functions to be exported  
> as undecorated C signatures, rather than fully decorated C++  
> signatures. This was the only way I could link against the mono  
> libraries (which I do statically). Am I misunderstanding something?

Mono is not being compiled as C++, so its signatures should be okay.

Instead of adding G_{BEGIN/END}_DECLS to Mono's C headers you could  
try doing export "C" { ... } around your #includes in your C++ files  
for simplicity.

Note that if you change Mono's headers you may need to clean your  
embedding project since it most likely doesn't notice such changed  
dependencies outside your project.


More information about the Mono-devel-list mailing list