views:

297

answers:

1

Hello, I am using VS 2008 and get compiler errors sporadically when adding a dll reference to a managed c++ file in my C++ project. I am trying to add a reference to the dll so as to be able to use smart pointers. ex: #import items.tlb

The problem is that the compiler crashes at sporadic places inside of items.tlh almost as though chunks of bytes where erased of missings , but when i open the file i can't find any reference to the aforementioned errors.

I tried to rebuild the whole project several times, tried on different machine, but although the compiler errors are not consistents and disappear alltogether sometimes , a fresh rebuild sometimes brings back the problem. I was told that the size of the generated .tlh file may be a reason but it doesn't really solve my problem or point me in the right direction.

Did anybody experienced the same symptoms? Thank you

+1  A: 

Whenever I've had this problem, it was caused by linking a Debug build to a Release DLL or a Release build to a Debug DLL.

Max Lybbert