LINK : fatal error LNK1104: cannot open file ‘atlthunk.lib’ 3


I was building webrtc on my notebook which OS is Win7 when I ran into this issue. I followed my previous steps which I suceeded to download and build the complete webrtc project:

  • Install Visual Studio 2010
  • Install DirectX SDK 2010(June)
  • Install Microsoft SDK v7.1

then downolad webrtc project including the project & settings for Visual Studio, and try to build it. You can view the detail steps here: http://rg4.net/archives/736.html.

“fatal error LNK1104: cannot open file’atlthunk.lib'”

First, I tried to add this pragma to the top of my header file. But problem remains.

#pragma comment(linker,”/NODEFAULTLIB:atlthunk.lib”)

Then I digged more into it.

Found out that atlthunk.lib belong to ATL7.1 , and ATL7.1 belongs to WinDDK. So what we need to do actually is download and install WinDDK. You can download it from this url:

http://download.microsoft.com/download/4/A/2/4A25C7D5-EFBE-4182-B6A9-AE6850409A78/GRMWDK_EN_7600_1.ISO

After downloaded and installed WinDDK, you still need to add this directory to VC’s library directories manually:

C:\WinDDK\7600.16385.1\lib\ATL\amd64

Then, re-open the webrtc’s all.sln, and rebuild the solution.

So the close note will be:

If you are building webrtc on WinXP, you need to install DirectX SDK 2010(June) and Microsoft SDK v7.1. But if you are building it on Win7, you need to install one more SDK, that is WinDDK v7.1.


Leave a comment

Your email address will not be published. Required fields are marked *

3 thoughts on “LINK : fatal error LNK1104: cannot open file ‘atlthunk.lib’

  • Andrew Porter

    Are you supposed to copy files into the C:\WinDDK\7600.16385.1\lib\ATL\amd64 folder or copy files out of that folder to somewhere else?

    • Jacky Wei Post author

      Sorry, I dont get it.
      If you ran into “fatal error LNK1104: cannot open file’atlthunk.lib’” on WIN7, then what you need to do is download and install WinDDK, and add “C:\WinDDK\7600.16385.1\lib\ATL\amd64” to VC’s library directories, or add this directory to your project settings manually.

  • Peter Du

    Thank you so much for your resources about webrtc!I encountered this error in my complying as well. Thanks to your information, I used you method and solve the problem successfully! Later, I found that the atlthunk.lib and other three .lib cound be found in the depot_tool folder. Maybe copying the four .lib files to the right directory could solve this problem a little easier. Hope it may help! Thank you again for your information!