Cannot link PVRTexLib on debug application

Hi, I am trying to link PVRTexLib.dll into a C# wrapper around some of the functionality offered by PVRTexTool. However I get this kind of error:

Error LNK2038: mismatch detected for ‘:ITERATOR_DEBUG_LEVEL: value’0’ doesn’t match value ‘2’ in AssemblyInfo.obj.

I did my investigation and it seems that I tried to link against a mismatching configuration of the import library (PVRTexLib.lib) which is actually built as release. This makes impossible to debug the C# wrapper around the library since I am forced to build the wrapper C# project in release.

I did not have this problem with previous versions of PVRTexLib.lib, which I could link either against Debug or Release versions of my wrapper.

How can I use PVRTexTool in a debug configuration?

Hello,

We do not have much experience wrapping a C++ library in C# but this error is probably due to mixing debug and release libraries at link time. We cannot provide debug libraries for PVRTexlib, but you could try to load the library at runtime rather than trying to link against it when his executable is being generated.

Regards.

Carlos.

Hello Carlos and thanks for answering. The path to pure dll linkage is one of the options I considered. That would be the way to go if it not were because there are whole classes in the header files that declared a number of member methods implementations of which are defined in the dll. The amount of work involved to emulate what the import library does to link every member method with its related implementation makes the approach near to worthless, since all we´re interested in is a couple of functions.

Hi,

Yes, you are right, our C++ interface will not make easy to use dynamic load. We have had for a long time in our roadmap to change this interface to pure C but we never got around to do it. We have re-scheduled it for some time next year. This will not fix your problem in the short term. We will think about which could be the best solution for you. By the way, I am assuming that linking all libraries in release mode does work fine. Is this true?

Regards.

Carlos.

“By the way, I am assuming that linking all libraries in release mode does work fine. Is this true?”

Yes, that’s correct.

© Imagination Technologies Limited. All rights reserved.
Privacy PolicyTerms & ConditionsTrademarksCookies