[英]How do you find which .lib file goes with which function?
In the linker settings you should tell the compiler which .lib files to include. 在链接器设置中,您应该告诉编译器要包括哪些.lib文件。 One simple thing that I haven't figured out is how to know which function is in which .lib file when using 3rd party software? 我尚未弄清的一件简单的事情是,在使用第三方软件时如何知道哪个函数在哪个.lib文件中?
Example: I was recently using Qt which has a huge number of .lib files. 例子:我最近使用的Qt有大量的.lib文件。 After trying those with most obvious names, I had to go through them all by trial and error until I found the correct one. 在尝试使用最明显的名称之后,我不得不反复尝试遍历所有名称,直到找到正确的名称为止。 I thought this information would be in the documentation of Qt but failed to find it. 我以为该信息会在Qt的文档中找到,但找不到。 I am still a beginner teaching myself so sometimes easy things like this pass me by. 我仍然是一个自学成才的初学者,因此有时诸如此类的简单事情会绕过我。
There are two basic approaches. 有两种基本方法。
The first option is to read the documentation for the third party library (Microsoft is very good at this - they include the library and header you need in each function. It seems Qt is not so good.) 第一种选择是阅读第三方库的文档(Microsoft非常擅长于此-它们在每个函数中都包含您需要的库和标头。看来Qt不太好。)
The second option is to list the names in each library with DUMPBIN as described here . 第二个选项是描述列出与DUMPBIN每个库的名字在这里 。
As noted in the comments, a variant of the second option is to grep the .lib files for a the plain text of the function names. 如注释中所述,第二个选项的一种变体是grep .lib文件,以获取函数名称的纯文本。 That will tell you which .lib files either define the function, or call it. 这将告诉您哪些.lib文件定义了该函数或对其进行了调用。 If there is only one, you are done; 如果只有一个,那么您就完成了。 if more than one, you will have to run DUMPBIN on all the returned files to see which defines it. 如果不止一个,则必须在所有返回的文件上运行DUMPBIN,以查看对其进行了定义。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.