I got this error when tried to compile..

1>------ Build started: Project: experiment, Configuration: Debug Win32 ------
1>Compiling...
1>commands.cpp
1>..\..\..\..\commands.cpp(19) : warning C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h(324) : see declaration of 'sscanf'
1>networking.cpp
1>..\..\..\..\networking.cpp(139) : warning C4996: 'itoa': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _itoa. See online help for details.
1> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(862) : see declaration of 'itoa'
1>..\..\..\..\networking.cpp(131) : warning C4101: 'iResult' : unreferenced local variable
1>..\..\..\..\networking.cpp(137) : warning C4101: 'tmp' : unreferenced local variable
1>..\..\..\..\networking.cpp(222) : warning C4996: 'itoa': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _itoa. See online help for details.
1> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(862) : see declaration of 'itoa'
1>..\..\..\..\networking.cpp(245) : warning C4996: 'itoa': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _itoa. See online help for details.
1> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(862) : see declaration of 'itoa'
1>..\..\..\..\networking.cpp(246) : warning C4996: 'itoa': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _itoa. See online help for details.
1> C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdlib.h(862) : see declaration of 'itoa'
1>Generating Code...
1>c:\documents and settings\daniel\my documents\networking.cpp(66) : warning C4700: uninitialized local variable 'iresult' used
1>Linking...
1>main.obj : error LNK2028: unresolved token (0A000290) "extern "C" int __stdcall AdjustTokenPrivileges(void *,int,struct _TOKEN_PRIVILEGES *,unsigned long,struct _TOKEN_PRIVILEGES *,unsigned long *)" (?AdjustTokenPrivileges@@$$J224YGHPAXHPAU_TOKEN_PRIVILEGES@@K1PAK@Z) referenced in function "void __cdecl EnableDebugPriv(void)" (?EnableDebugPriv@@$$FYAXXZ)
1>main.obj : error LNK2028: unresolved token (0A0002CB) "extern "C" int __stdcall LookupPrivilegeValueA(char const *,char const *,struct _LUID *)" (?LookupPrivilegeValueA@@$$J212YGHPBD0PAU_LUID@@@Z) referenced in function "void __cdecl EnableDebugPriv(void)" (?EnableDebugPriv@@$$FYAXXZ)
1>main.obj : error LNK2028: unresolved token (0A000341) "extern "C" int __stdcall OpenProcessToken(void *,unsigned long,void * *)" (?OpenProcessToken@@$$J212YGHPAXKPAPAX@Z) referenced in function "void __cdecl EnableDebugPriv(void)" (?EnableDebugPriv@@$$FYAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall AdjustTokenPrivileges(void *,int,struct _TOKEN_PRIVILEGES *,unsigned long,struct _TOKEN_PRIVILEGES *,unsigned long *)" (?AdjustTokenPrivileges@@$$J224YGHPAXHPAU_TOKEN_PRIVILEGES@@K1PAK@Z) referenced in function "void __cdecl EnableDebugPriv(void)" (?EnableDebugPriv@@$$FYAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall LookupPrivilegeValueA(char const *,char const *,struct _LUID *)" (?LookupPrivilegeValueA@@$$J212YGHPBD0PAU_LUID@@@Z) referenced in function "void __cdecl EnableDebugPriv(void)" (?EnableDebugPriv@@$$FYAXXZ)
1>main.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall OpenProcessToken(void *,unsigned long,void * *)" (?OpenProcessToken@@$$J212YGHPAXKPAPAX@Z) referenced in function "void __cdecl EnableDebugPriv(void)" (?EnableDebugPriv@@$$FYAXXZ)
1>C:\Documents and Settings\Daniel\My Documents\Visual Studio 2008\Projects\experiment\Debug\experiment.exe : fatal error LNK1120: 6 unresolved externals
1>Build log was saved at "file://c:\Documents and Settings\Daniel\My Documents\Visual Studio 2008\Projects\experiment\experiment\Debug\BuildLog.htm"
1>experiment - 7 error(s), 8 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Recommended Answers

All 5 Replies

It can't find the implementation of "AdjustTokenPrivileges", maybe your prototype (declaration) doesn't match the header of the definition for the function?

Most of your errors are due to incorrect usage of the "extern" keyword. This should help.

Please help me fix my code thx..


<code removed due to questionable legality>

commented: I fail to see the point of helping some wannabe who just "found some hack code" on the web, and now demands that we fix it. -4
commented: Entirely agree with Salem. Also reported this post. The program itself is easy to fix, but you obviously don't actually know anything about what you have in front of you. -2

OK What gives?
1st post - a sh*tload of errors with no context
2nd post - code with no commentary, no questions, two days later
3rd post - worthless bump for no apparent reason
4th post - another worthless bump for no apparent reason

This thread is about to be closed...

This is code to enable a user to cheat during online play at warcraft 3. I would kindly ask that you at least remove the post of the code before/after you close it. It wouldn't be so bad if he was trying to write one himself, but this is blatant copy paste from somewhere.

I abhor cheating, especially by script kiddies, which is I believe what v1nc3nt is...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.