Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot Open File atls.lib

I have atls.lib in my hard drive, but I can't link it into my Visual Studio project. I know that atls.lib is an ATL specific library file, and I have all the ATL files/headers/libraries. However, I still can't link them.

LINK : fatal error LNK1104: cannot open file 'atls.lib'

Can anyone help a helpless programmer?

Thank you very much.

like image 920
John Doe Avatar asked Jun 20 '12 15:06

John Doe


3 Answers

Fixed for me by installing the following Individual Component through the Visual Studio Installer:

  • C++ ATL for latest v142 build tools with Spectre Mitigations (x86 & x64)

I'm running a 32 bit C# project using VS2019.

like image 136
ChickenFeet Avatar answered Nov 03 '22 11:11

ChickenFeet


In my case the problem was missing ATL/MFC libraries for x64, I had to add them in the Visual Studio installer (it was an open source project, so I wasn't aware of the requirement).

Once again, the invaluable procmon did the job:
While atls.lib was found under $(VCInstallDir)atlmfc\lib the linker looked in $(VCInstallDir)atlmfc\lib\amd64.

like image 11
chalion Avatar answered Nov 03 '22 09:11

chalion


Just to keep this question updated, I encountered this error after running the install for Spectre, the VC++ spec code mitigation tool. After looking at the VC++ directories, I noticed that both the Include Directories and the Library Directories have changed to add a "Spectre" addition to the path, while the original path to the actual file is no longer there. I will update this later after I figure out whether Spectre didn't install correctly, or if simply changing the path will solve the issue; I do NOT want the speculative attack exposed in my code, which apparently happens with ATL code.

EDIT

My compiler is VS 2017 Community Edition.

EDIT

The solution that worked for me is here, discovered by Holger Schmeken

like image 10
Stanley Jointer II Avatar answered Nov 03 '22 09:11

Stanley Jointer II