如何在Visual Studio c\c ++中将库添加到新的库项目中 [英] how to add a library into a new library project in Visual Studio c\c++

查看:236
本文介绍了如何在Visual Studio c\c ++中将库添加到新的库项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我知道如何添加dll或static库进入我的项目但最近我遇到了一种情况,我需要在我的新dll /静态库项目中添加一个DLL库(我还没有决定:))我不能按照与"普通"相同的方式进行操作;
prjects喜欢  properties-> c\ c ++ - > general-> additional ....
i看不到属性中的任何LINK类别?!你能帮我找到"LINK":)或者告诉我如何用另一种方式做到这一点吗?我顺便使用c / c ++:)

I know how to add a dll or static library into my project but recently i have come to a situation that i need to add a dll library into my new dll/static library project (i have NOT decided yet:)) and i cannot follow the same way i did with "ordinary" prjects like properties->c\c++->general->additional....but i don`t see any LINK category in properties?!. Can you please help me find that "LINK":) or show me how to do that in another way? I am working with c/c++ by the way:)


编辑: 我包括我的lib但是不能链接它并显示哪些lib
i需要使用如Link-> input .... my.lib

 i am including my lib but can`t link it and show which lib i need to use like Link->input .... my.lib

推荐答案

要将Dlls导入库添加到项目,请参阅
https://docs.microsoft.com/en-us/cpp/build/reference/dot-lib-files-as-linker-input

或者,您可以在源代码中使用#pragma指令 -

Alternatively, you can use the #pragma directive in source code --

#pragma comment(lib, "libfile")

请参阅
https://msdn.microsoft.com/en-us/library/ 7f0aews7.aspx

See https://msdn.microsoft.com/en-us/library/7f0aews7.aspx


这篇关于如何在Visual Studio c\c ++中将库添加到新的库项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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