首页
社区
课程
招聘
请教一个C++程序的编译问题
发表于: 2013-3-14 13:51 5272

请教一个C++程序的编译问题

2013-3-14 13:51
5272
微软曾开源过一个操作系统SID修改工具.
我从网上下载回来了.但无法编译通过..到底是没学过C++

麻烦帮忙看一下.请教下如何编译..

报错信息:

Compiling...
sid.cpp
c:\test\sid.h(69) : error C2065: 'COMPUTER_NAME_FORMAT' : undeclared identifier
c:\test\sid.h(69) : error C2146: syntax error : missing ')' before identifier 'NameType'
c:\test\sid.h(69) : error C2165: 'left-side modifier' : cannot modify pointers to data
c:\test\sid.h(69) : error C2071: 'SETCOMPUTERNAMEEX' : illegal storage class
c:\test\sid.h(71) : error C2059: syntax error : ')'
c:\test\sid.cpp(94) : error C2664: 'swprintf' : cannot convert parameter 1 from 'char [256]' to 'unsigned short *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(123) : error C2664: 'wcslen' : cannot convert parameter 1 from 'char *' to 'const unsigned short *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(768) : error C2664: 'GetRegSecDesc' : cannot convert parameter 2 from 'unsigned short [9]' to 'char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(774) : error C2664: 'RegOpenKeyA' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(777) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [48]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(782) : error C2664: 'SetRegAccess' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(786) : error C2664: 'RegQueryValueExA' : cannot convert parameter 2 from 'unsigned short [2]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(788) : error C2664: 'RegQueryValueExA' : cannot convert parameter 2 from 'unsigned short [2]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(792) : error C2664: 'SetRegAccess' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(794) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [48]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(806) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [61]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(901) : error C2664: 'ChangeComputerSID' : cannot convert parameter 2 from 'unsigned short [9]' to 'char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(908) : error C2664: 'ChangeComputerSID' : cannot convert parameter 2 from 'unsigned short [34]' to 'char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(925) : error C2664: 'ChangeComputerSID' : cannot convert parameter 2 from 'unsigned short [57]' to 'char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(931) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [97]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(947) : error C2065: 'ComputerNamePhysicalDnsHostname' : undeclared identifier
c:\test\sid.cpp(986) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [102]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1077) : error C2065: '_beginthread' : undeclared identifier
c:\test\sid.cpp(1247) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [67]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1256) : error C2664: 'RegOpenKeyA' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1260) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [55]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1269) : error C2664: 'SetRegAccess' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1272) : error C2664: 'RegQueryValueExA' : cannot convert parameter 2 from 'unsigned short [2]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1274) : error C2664: 'RegQueryValueExA' : cannot convert parameter 2 from 'unsigned short [2]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1278) : error C2664: 'SetRegAccess' : cannot convert parameter 2 from 'unsigned short [29]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1280) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [55]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1294) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [68]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1316) : error C2664: 'MessageBoxA' : cannot convert parameter 2 from 'unsigned short [47]' to 'const char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1725) : error C2664: 'DisplayError' : cannot convert parameter 1 from 'unsigned short [75]' to 'char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1734) : error C2664: 'DisplayError' : cannot convert parameter 1 from 'unsigned short [75]' to 'char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1741) : error C2664: 'DisplayError' : cannot convert parameter 1 from 'unsigned short [75]' to 'char *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1751) : error C2664: 'CommandLineToArgvW' : cannot convert parameter 1 from 'char *' to 'const unsigned short *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
c:\test\sid.cpp(1752) : error C2664: 'ProcessArguments' : cannot convert parameter 2 from 'unsigned short ** ' to 'char *[]'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
执行 cl.exe 时出错.

[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)

上传的附件:
收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 323
活跃值: (49)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
在头文件里加上:
typedef enum _COMPUTER_NAME_FORMAT { 
  ComputerNameNetBIOS,
  ComputerNameDnsHostname,
  ComputerNameDnsDomain,
  ComputerNameDnsFullyQualified,
  ComputerNamePhysicalNetBIOS,
  ComputerNamePhysicalDnsHostname,
  ComputerNamePhysicalDnsDomain,
  ComputerNamePhysicalDnsFullyQualified,
  ComputerNameMax
} COMPUTER_NAME_FORMAT;
2013-3-14 14:11
0
雪    币: 162
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
解决了,灰常感谢...
2013-3-14 16:47
0
游客
登录 | 注册 方可回帖
返回
//