-1

这是我第一次使用opencv。我下载了它并设置了visual studio 2010(pro)包含这样的目录:

C:\opencv\build\include\opencv
C:\opencv\build\include

“继承”的值是:

$(VCInstallDir)include
$(VCInstallDir)atlmfc\include
$(WindowsSdkDir)include
$(FrameworkSDKDir)\include

但是当我编译时,我收到有关 windows sdk 的错误...

1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ws2def.h(212): error C2011: 'sockaddr' : 'struct' type redefinition
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winsock.h(485) : see declaration of 'sockaddr'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ws2def.h(390): error C2059: syntax error : 'constant'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ws2def.h(443): error C2143: syntax error : missing ';' before '}'
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ws2def.h(443): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ws2def.h(443): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ws2def.h(524): warning C4005: 'IN_CLASSA' : macro redefinition
1>c:\program files (x86)\microsoft sdks\windows\v7.0a\include\winsock.h(287) : see previous definition of 'IN_CLASSA'
...

与 sdk 包含文件存在一些冲突。有谁知道我该如何解决这个问题?谢谢

4

1 回答 1

1

正在使用winsock2.h,由于某种原因与opencv冲突。将其更改为winsock.h

于 2012-05-25T19:59:59.240 回答