LNK1104无法打开文件..... / myproj.lib [英] LNK1104 cannot open file ...../myproj.lib

查看:187
本文介绍了LNK1104无法打开文件..... / myproj.lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在解决方案中有多个C ++项目。其中一个项目是一个DLL项目(它在配置中设置),我想测试它。


为此我需要以某种方式将它包含在我的测试谷歌测试项目中。我设法包含到VC ++目录,所以我可以使用DLL项目和intellisense工作。


但是我无法构建我的测试项目,因为链接器失败并且标题中出现错误消息。


myproj是一个DLL项目。怎么应该有.lib导出?我怎么能在另一个项目中导入该DLL项目呢?




asd

解决方案

你好,


你有构建dll和lib文件吗?确保您的项目可以找到lib文件的路径。


以下是一些更多信息:


https://social .msdn.microsoft.com /论坛/ vstudio / EN-US / 15e4fc47-68b5-4798-9e5d-d6d72da1f631 /视觉工作室犯规-生成-A-LIB-文件?论坛= vcgeneral


https://stackoverflow.com/questions/584041/how-do-i-build-an-import-library-lib-and-a-dll-in-visual-c


https://www.codeproject.com / Articles / 85391 / Microsoft-Visual-C-Static-and-Dynamic-Libraries


此致,Guido <一个HREF = "https://stackoverflow.com/questions/584041/how-do-i-build-an-import-library-lib-and-a-dll-in-visual-c"> <一个HREF ="https://social.msdn.microsoft.com/Forums/vstudio/en-US/15e4fc47-68b5-4798-9e5d-d6d72da1f631/visual-studio-doesnt-generate-a-lib-file?forum=vcgeneral ">


I have multiple C++ projects within a solution. One of the projects is a DLL project (it is set in configs) and I want to test it.

For that I need to include it in my Tests google test project somehow. I managed to include to the VC++ directories so I can use the DLL project and intellisense works.

However I cannot build my test project because the linker fails with the error message in the title.

The myproj is a DLL project. How is it supposed to have a .lib export? How could I import that DLL project in another project then?


asd

解决方案

Hello,

have you build the dll and lib file? Ensure that your project can find the path to the lib file.

Here are some more informations:

https://social.msdn.microsoft.com/Forums/vstudio/en-US/15e4fc47-68b5-4798-9e5d-d6d72da1f631/visual-studio-doesnt-generate-a-lib-file?forum=vcgeneral

https://stackoverflow.com/questions/584041/how-do-i-build-an-import-library-lib-and-a-dll-in-visual-c

https://www.codeproject.com/Articles/85391/Microsoft-Visual-C-Static-and-Dynamic-Libraries

Regards, Guido


这篇关于LNK1104无法打开文件..... / myproj.lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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