将 dll 引用添加到托管 c++ 时出现编译器错误 项目
我正在使用 VS 2008,在我的 C++ 项目中添加对托管 C++ 文件的 dll 引用时,偶尔会出现编译器错误。 我正在尝试添加对 dll 的引用,以便能够使用智能指针。 ex: #import items.tlb
问题是编译器在 items.tlh 内部的零星位置崩溃,几乎就像删除了缺失的字节块一样,但是当我打开文件我找不到任何对上述错误的引用。
我多次尝试重建整个项目,在不同的机器上尝试,但是尽管编译器错误不一致并且有时会完全消失,但重新重建有时会再次出现问题。 有人告诉我,生成的 .tlh 文件的大小可能是一个原因,但它并没有真正解决我的问题或为我指明正确的方向。
有人经历过同样的症状吗? 谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每当我遇到此问题时,都是由将调试版本链接到发布 DLL 或将发布版本链接到调试 DLL 引起的。
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.