Question: run time error using a native lib

  • Thread starter Ladvánszky Károly
  • Start date
L

Ladvánszky Károly

I'm trying to use a statically linked C library. I've wrapped a .NET C++ DLL
around this lib and trying to drive the wrapper from a .NET VB testbed. The
whole build succeeds but I get the following error message at runtime:

An unhandled exception of type 'System.TypeLoadException' occurred in
TiffLibXTester.exe

Additional information: Could not load type tiff from assembly TiffLibX,
Version=1.0.1425.19884, Culture=neutral, PublicKeyToken=null.

I would appreciate any help on this and in general, on what the best way is
to use legacy libraries (either lib or dll) from .NET.

Thanks,

Ladvánszky Károly
 
P

Pent

it's probably forward declared as
struct tiff;
What you need to do in MC++ is:
struct tiff{};
 
L

Ladvánszky Károly

Thanks for your answer.
Where should I place it in MC++? Everything compiles and links with no
problem.

Károly
 
L

Ladvánszky Károly

To my surprise, it has worked. I have the source files of the library in
question and struct tiff is declared.
What does this empty struct declaration do?
Could you please explain the solution a little more detailed?
Is it MC++ specific?

Thanks,

Károly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top