Search code examples
visual-studio-2005shellexecutegoogletest

shellapi error when building Google Test


I downloaded Google Test. Then i opened "gtest.sln" file. After conversion i clicked "build" but Visual Studio 2005 gave the errors below repeatedly. What should i do? Thank you

3>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\shellapi.h(69) : error C2065: 'WHWND' : undeclared identifier
3>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\shellapi.h(69) : error C2146: syntax error : missing ')' before identifier 'hwnd'
3>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\shellapi.h(69) : warning C4229: anachronism used : modifiers on data are ignored
3>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\shellapi.h(69) : error C2491: 'ShellExecute' : definition of dllimport data not allowed
3>C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include\shellapi.h(69) : error C2059: syntax error : ')'

Solution

  • You probably need to change the order of include directories.

    It seems to be you have PlatformSDK first in the include path; try to move it "down" so that VS include directories will be used first. It's probably that gtest is not compatible with your version of PlatformSDK.

    Good luck!