C ++ Linker在哪里找到LIB文件? [英] Where does C++ Linker find LIB files?

查看:150
本文介绍了C ++ Linker在哪里找到LIB文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到链接错误1104(和1181),找不到LIB文件。我在VS2005设置中没有提及LIB文件的引用。而且我不想使用该文件,因此我不想设置路径以便找到它。



链接器如何知道要查找的文件名。我查看了所有项目属性等。我在项目和整个计算机上执行了文本搜索但没有成功。

I get a link error 1104 (and 1181) where it can't find a LIB file. I have no references in VS2005 settings that mention the LIB file. And I don't want to use that file so I don't want to set a path so that it finds it.

How does the linker even know the file name to look for. I've looked at all the project properties, etc. I've performed a text search in the project and the entire computer without success.

推荐答案

1。在您的C / C ++源代码中查找
1. Look for a
#pragma comment(lib, "xyz")

是库名。



2.作为完整性检查,在文本编辑器中打开项目和解决方案文件并搜索库名。

in your C / C++ source where xyz is the library name.

2. as a sanity check, open the project and solution files in a text editor and search for the library name.

< br>

点击 Project-> Properties 菜单项,然后在新出现的对话框中选择配置属性 - > VC ++目录节点。在右侧,您可以找到 .LIB 搜索路径的列表(库目录)。



Click on Project->Properties menu item and then , on the newly appeared dialog select the Configuration Properties->VC++ Directories node. On the right, you may find the list of the .LIB search paths (Library Directories).

Quote:

而且我不想使用该文件所以我不想要设置路径以便找到它。

And I don't want to use that file so I don't want to set a path so that it finds it.

你必须确定你知道你在做什么。任何可执行文件需要 DLL s和 LIB 文件是链接器需要的,以便构建能够正确加载的应用程序 DLL 在运行时。

You have to be sure you know what are you doing. Any executable needs DLLs and LIB files are required by the linker in order to build an application able to load correctly the DLLs at runtime.


来自 bling 的建议向我指出了解决方案。我正在使用第三方控件。他们在其中一个头文件中动态创建了#pragma comment语句。根据项目编译设置,它创建了一个库名称并查找它。



谢谢BLING
The suggestion from bling pointed me to the solution. I am using third party controls. They dynamically created the #pragma comment statement in one of their header files. Based upon the projects compile settings, it created a library name and looked for it.

Thanks BLING


这篇关于C ++ Linker在哪里找到LIB文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆