obiwanjacobi
obiwanjacobi

Reputation: 2463

Why does Win32 API LoadLibrary fail when loading a dll linked to libmonosgen-2.0?

I have made a win C/C++ dll that embeds the Mono Clr - it's only a couple of calls at the moment. I have linked to the calls using the .def file (and some tweaking) to generate a .lib. These calls are in a file called libmonosgen-2.0.dll. No error is shown that says the libmonosgen-2.0.dll cannot be found.

When I try to load my .dll with a C/C++ test app using the LoadLibrary Win32 API, it fails with code 193/C1 - bad image. When I remove the link to the libmonosgen-2.0.dll, it loads fine again.

I have looked at my dll with Dependency-Walker but no odd dependencies are there (all system32 stuff).

I really have no clue why this problem exists.

PS: I cannot put the Mono embedding code in an .exe because I am building a plugin - it has to be a .dll.

EDIT: I had 32-bit and 64 bit images mixed. The mono install is 32-bit (3.2.3 at least).

Upvotes: 0

Views: 782

Answers (0)

Related Questions