Я пытаюсь использовать GPEdit.h в своем проекте, но он не компилируется со многими ошибками:
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(31,0): Error C2065: 'CLSID_GPESnapIn': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(31,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(31,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(43,0): Error C2065: 'NODEID_Machine': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(43,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(43,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(43,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(51,0): Error C2065: 'NODEID_MachineSWSettings': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(51,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(51,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(51,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(59,0): Error C2065: 'NODEID_User': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(59,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(59,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(59,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(67,0): Error C2065: 'NODEID_UserSWSettings': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(67,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(67,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(67,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(75,0): Error C2065: 'IID_IGPEInformation': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(75,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(75,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(75,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(83,0): Error C2065: 'CLSID_GroupPolicyObject': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(83,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(83,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(83,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(91,0): Error C2065: 'IID_IGroupPolicyObject': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(91,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(91,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(91,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(119,0): Error C2065: 'CLSID_RSOPSnapIn': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(119,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(119,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(119,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(127,0): Error C2065: 'NODEID_RSOPMachine': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(127,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(127,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(127,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(135,0): Error C2065: 'NODEID_RSOPMachineSWSettings': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(135,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(135,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(135,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(143,0): Error C2065: 'NODEID_RSOPUser': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(143,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(143,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(143,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(151,0): Error C2065: 'NODEID_RSOPUserSWSettings': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(151,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(151,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(151,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(159,0): Error C2065: 'IID_IRSOPInformation': undeclared identifier
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(159,0): Error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(159,0): Error C2374: 'DEFINE_GUID': redefinition; multiple initialization
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(159,0): Error C2440: 'initializing': cannot convert from 'initializer list' to 'int'
Я попытался использовать .c
расширение файла, и получил некоторые другие ошибки:
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(31,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(43,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(51,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(59,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(67,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(75,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(83,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(91,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(119,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(127,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(135,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(143,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(151,0): Error C2059: syntax error: 'constant'
0>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\gpedit.h(159,0): Error C2059: syntax error: 'constant'
Но я хочу использовать C ++, поэтому мне нужно исправить проблему с .cpp
.
Я использую Visual Studio 2017 с последними обновлениями из установщика Visual Studio, также установлена рабочая нагрузка «Разработка на рабочем столе с C ++». Проблема появляется в Windows 10 с последними стабильными обновлениями.
Мой код довольно прост:
#include "gpedit.h"
int main(int argc, char** argv) {
return 0;
}
GPEdit.h:
https://pastebin.com/ie55xWhp