• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 8 of 8
    1. #1
      Shootin Pool!
      Syperus's Avatar
      Join Date
      Oct 2012
      Thanks (-->)
      Thanks (<--)

      [Tutorial]Visual Studio Linker Errors

      John Kittz
      Visual Studio Linker Errors
      When I was finishing up my Black Ops trainer and started compiling the release I came across a few errors that I haven't seen before. After doing online searches for awhile I came to find out that Microsoft has a bug in their linker system. The linker system is suppose to tell the compiler where it can find the needed resources and references when compiling the executable or DLL. The errors I came across were

      LNK2001 and 2019 are pretty much the same thing from what I could find. From MSDN:
      unresolved external symbol 'symbol' referenced in function 'function'
      I noticed while doing my searching that a lot of people ended up using the debug version as the release. I personally think that is a bad idea since there are other tools that are working with debug mode to help find problems with the program. I saw the other day someone on these forums had this exact same problem. I decided to write up this tutorial on how to resolve these issues if you come across it. I will be using my Black Ops project for this trainer and show how I resolved the problem.

      Error LNK2028 & LNK2019
      When I first attempted to compile my release program it returned 5 errors (multiple 2028 &2019. Also an Error LNK1120 but it's fixed with these steps).

      Click image for larger version. 

Name:	error1.jpg 
Views:	51 
Size:	162.1 KB 
ID:	1648

      For this problem you need to open your Configuration Manager (Build->Configuration Manager, or ALT+F7 with the current focus window being Solution Explorer or your coding). In the Configuration Properties there will be a subcategory C/C++. Click on the arrow and click on the Optimization subcategory. There will be an option at the bottom called Whole Program Optimization as seen in the picture below

      Click image for larger version. 

Name:	error2.jpg 
Views:	65 
Size:	119.9 KB 
ID:	1649

      You need to select the Yes(/GL) option. What this does is let the compiler optimize all your code for you instead of you specifying specific functions to inline.

      Error LNK2001

      Once that was complete I cleaned and recompiled the program and got three errors

      Click image for larger version. 

Name:	error3.jpg 
Views:	24 
Size:	62.4 KB 
ID:	1650

      The compiler was unable to find the GetWindowThreadProcessID and FindWindowW definitions which are defined in WinUser.h. But WinUser.h is already defined in the <Windows.h> header so I looked up the library that these two functions used at MSDN and both were declared in user32.lib. From that it looked like user32.lib isn't declared in my project which I thought was weird because it should of been. I opened my Configuration Manager back up and went to Configuration Properties->Linker->Input. From here the first row should be Additional Dependencies. Click on the drop down and click Edit. This will open the window and show the library's you called and the bottom shows Inherited Libraries. I thought that meant they were already declared in my project, but for some reason they weren't. So I added use32.lib to the top text box.

      Click image for larger version. 

Name:	error4.jpg 
Views:	11 
Size:	40.0 KB 
ID:	1651

      From here i clicked ok, accept, ok, and recompiled my program error free.

      Hopefully this will help anyone having these or similar issues. Before anyone asks I know I could have just told you to do both the Optimization and Linker Input steps at the same time, but I wanted to show them separately in case someone comes across one or the other and explain why it's happening.

      To the Admin/Moderators: I posted in this section since were not permitted to post in the tutorials section and this looked like the next best section to post it. If it isn't then I apologize.
      Blacks Ops Zombies, BioShock Infinite Array of Bytes
      "People say I'm a bad influence. I say the world's already fucked, I'm just adding to it" -Eminem

    2. Thanks N/A thanked for this post
    3. #2
      Learning to hack games!
      Fleep's Avatar
      Join Date
      May 2012
      Thanks (-->)
      Thanks (<--)
      Excellent, people are always having trouble with these so good 1 for providing fixes.

      Definately deserves a sticky but I think this may belong in the c++ section.


    4. #3
      Shootin Pool!
      Syperus's Avatar
      Join Date
      Oct 2012
      Thanks (-->)
      Thanks (<--)
      Quote Originally Posted by Fleep View Post
      I think this may belong in the c++ section.
      Yea I think you're right. I thought people were having these same errors in different languages, but now that I looked closer at the searches I see it looks like it's more a C++ based issue. My bad.
      Blacks Ops Zombies, BioShock Infinite Array of Bytes
      "People say I'm a bad influence. I say the world's already fucked, I'm just adding to it" -Eminem

    5. #4
      Kim Kong Trasher
      I don't have status.
      c5's Avatar
      Join Date
      Jul 2012
      Mankei Iland
      Thanks (-->)
      Thanks (<--)
      Another option would be

      #pragma comment (lib, "user32.lib")
      Pleasant tutorial
      [Tutorial]Visual Studio Linker Errors

    6. #5
      Global Moderator
      give me my colorz back
      till0sch's Avatar
      Join Date
      Oct 2012
      Thanks (-->)
      Thanks (<--)
      Thanks, but somehow only the one error (LNK2019) is fixed
      I followed the other one added user32.lib but somehow nothing changed

    7. #6
      Learning to hack games!
      Feeling Normal
      's Avatar
      Join Date
      Jan 1970
      Thanks (-->)
      Thanks (<--)
      Thread has been moved to the C/C++ section and is stickied.

    8. Thanks Syperus thanked for this post
    9. #7
      Learning to hack games!
      Feeling Normal
      waynetay's Avatar
      Join Date
      Nov 2013
      Thanks (-->)
      Thanks (<--)
      I still gt a error in the d3d9dev.cpp it say couldnt open file "Hacks.h" -_- anyone can help me?

    10. #8
      Somewhere Causing Trouble
      Hate Mailing
      Marcus's Avatar
      Join Date
      Jan 2013
      Thanks (-->)
      Thanks (<--)
      Thanks mate! Could be useful

    Similar Game Hacker Threads

    1. Visual Studio Scheme
      By keto in forum Polls
      Replies: 9
      Last Post: 04-21-2015, 05:22 PM
    2. Visual studio vs Codeblocks
      By Nailo in forum C/C++
      Replies: 8
      Last Post: 01-22-2015, 04:37 PM
    3. [Help] Wrong with Visual studio?
      By Droxx1998 in forum Hacking Help
      Replies: 5
      Last Post: 11-15-2014, 03:55 PM
    4. [HELP] Visual Studio Error
      By pwned00 in forum C#
      Replies: 5
      Last Post: 12-14-2012, 04:58 PM
    5. Anyone using Visual Studio 2012 right now?
      By shuuk in forum Hacking Help
      Replies: 15
      Last Post: 12-07-2012, 01:06 PM

    Tags for this Thread