error RC1015: cannot open include file ‘sal.h’.

发布于 2020-05-05  49 次阅读


问题描述

windows驱动开发出现如下错误:

1>errors in directory xxx/xxx/xxx

1>e:winddk7600incapispecstrings.h(11) : error RC1015: cannot open include file ‘sal.h’.

1>e:winddk7600incapispecstrings.h(11) : error C1083: Cannot open include file: ‘sal.h': No such file or directory

1>e:winddk7600incapispecstrings.h(11) : error C1083: Cannot open include file: ‘sal.h': No such file or directory

1>e:winddk7600incapispecstrings.h(11) : error C1083: Cannot open include file: ‘sal.h': No such file or directory

1>e:winddk7600incapispecstrings.h(11) : error C1083: Cannot open include file: ‘sal.h': No such file or directory

1>e:winddk7600incapispecstrings.h(11) : error C1083: Cannot open include file: ‘sal.h': No such file or directory

1>e:winddk7600incapispecstrings.h(11) : error C1083: Cannot open include file: ‘sal.h': No such file or directory

1>link : error LNK1181: cannot open input file ‘xx/xxx/xxx/xxx.res’

 

解决方法:

拷贝F:Program Files (x86)Microsoft Visual Studio 10.0VCincludesal.h,然后覆盖掉X:WinDDK7600.16385.1incapisal.h。

但是这样就会出现另外问题:

1>e:winddk7600incapisal.h(160) : fatal error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>errors in directory f:driverbookswindowsdriverdevelopmentinternalscodechapter20testcap

1>e:winddk7600incapisal.h(160) : error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>capirq.c

1>e:winddk7600incapisal.h(160) : fatal error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>e:winddk7600incapisal.h(160) : error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>capvideo.c

1>e:winddk7600incapisal.h(160) : fatal error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>e:winddk7600incapisal.h(160) : error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>capxfer.c

1>e:winddk7600incapisal.h(160) : fatal error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>e:winddk7600incapisal.h(160) : error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>capprop.c

1>e:winddk7600incapisal.h(160) : fatal error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>e:winddk7600incapisal.h(160) : error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>ddraw.c

1>e:winddk7600incapisal.h(160) : fatal error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

1>e:winddk7600incapisal.h(160) : error C1083: Cannot open include file: ‘codeanalysissourceannotations.h': No such file or directory

Microsoft Visual Studio 10.0VCincludesal.h 中include了CodeAnalysissourceannotations.h,所以如果在编译环境中调用build,会出现错误找不到 sourceannotations.h,

所以还要把 Microsoft Visual Studio 10.0VCincludeCodeAnalysis  拷贝到 D:WinDDK7600.16385.1incapi


一沙一世界,一花一天堂。君掌盛无边,刹那成永恒。