开发者

How to exclude .lib file from linker command line argument in VC++

开发者 https://www.devze.com 2023-02-02 02:34 出处:网络
I am compiling a vc++ program开发者_运维问答 which is showing below error error LNK1104: cannot open file \'D:\\Visual Studio 2010\\Projects\\credentialproviders\\Win32\\Debug\\Helpers.lib\'

I am compiling a vc++ program开发者_运维问答 which is showing below error error LNK1104: cannot open file 'D:\Visual Studio 2010\Projects\credentialproviders\Win32\Debug\Helpers.lib'

how i can remove that Helpers.lib file reference from linker command line argument because in project settings->linker->commandline its in readonly mode and I can't edit this to remove that line. I am using Visual Studio 2010.

thanks


Search the .vcproj file, and the project source code for "Helpers.lib". There are a couple places it can get linked in, and this is the simplest way to find it.

Otherwise, look for:

  1. Project properties -> linker -> inputs
  2. In the solution explorer, see if the .lib is included anywhere in the project tree.
  3. Anywhere in the source code, #pragma comment(lib, "helpers.lib")
  4. If Helpers is a project in your solution, check project dependencies for the project. By default, thisk linking is done implicitly if the project depends on it.


if this lib is not referenced in Linker->Input->Additional Dependencies, so check Project Dependencies, and remove any dependency on porject Helpers. also it's possible that this linking is done from code by #pragma comment(lib, "Helpers)


I don't really think the above answers it properly. I just had this same problem and the way to fix it is to go to View->Property Manager. double click Microsoft.Cpp.Win32.user and go to Linker->Input. There you can edit out the additional dependencies that were previously read only. Do it for both debug/release versions if needed.

0

精彩评论

暂无评论...
验证码 换一张
取 消