Driver C++ issue

Driver C++ issue

issue 1

找不到d3dkmthk.h,查找發現d3dkmthk.h位於km下於是添加C++附加查找目錄可以解決

$(WindowsSdkDir)Include\$(TargetPlatformVersion)\km\

issue 2

error C2280: 'A::A(const A&)': attempting to reference a deleted function

關於這個錯誤,這裏有交代 Deleted copy constructors

Deleted_implicitly-declared_copy_assignment_operator

issue 3

由於需要編譯下驅動,down了分代碼下來編譯總是出現莫名的錯誤

error LNK2019: unresolved external symbol "void __cdecl operator delete[](void *,unsigned int)"

不過最終找到了答案,Link errors when trying to compile against an old STD library and windows SDK

So, after reading a lot of breaking changes documentations i found a flag that can suppress these new c++14 delete implementations here, under Placement new and delete.

Adding the flag /Zc:sizedDealloc- removes the missing operator delete() implementations.
Project properties -> Configuration Properties -> C/C++ -> Command Line -> /Zc:sizedDealloc-

you can revert to the old behavior by using the compiler option /Zc:sizedDealloc-. If you use this option, the two-argument delete functions don’t exist and won’t cause a conflict with your placement delete operator.

For the eh vector destructor iterator error I’ve opened a separate question, and answered it there.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章