Answer the question
In order to leave comments, you need to log in
Why can't I connect an unmanaged dll?
I'll give you a simple example.
There is the following C++ library:
And there is a C# code that uses it:
And here the magic begins:
When the C++ library is compiled with VC++, everything works fine, but through TDM-GCC it throws an exception (on the screenshot).
But when I change the target platform from .NET 4.6.2 to .NET 4.0 in the C# project settings, everything starts working with the library compiled via TDM-GCC.
How can this behavior be explained?
How can I include a TDM-GCC compiled library in a .NET 4.6.2 project?
Answer the question
In order to leave comments, you need to log in
Look at the bit depth of the library and C# program.
The C# program, if nothing is changed, runs under x64. TDM-GCC most likely compiles for x86.
Link libraries must match the program from which they are called.
Convert everything to x64 or x86.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question