如何在Visual Studio中设置DLL文件的路径? [英] How do I set the path to a DLL file in Visual Studio?
问题描述
此应用程序无法启动,因为xxx。 dll没有找到。
所以我必须将DLL文件复制到与.vcproj文件相同的目录。
有没有办法设置项目来查找(最好)一些相对路径的DLL文件(或不优选)一些绝对路径?
类似的概念,我们如何在项目设置中设置包含和库路径。
我的意思是当我调试我的应用程序(击中 F5 )将弹出上述错误。
- 转到项目属性(Alt + F7)
- 在调试中,向右看
- 有一个环境字段。
- 添加相对路径(相对于vcproj文件夹),即.. \some-framework \lib,通过追加
PATH =%PATH%; $(ProjectD \some-framework \lib
或者前缀到路径PATH = C:\some-framework \lib;%PATH%
- 再次点击F5(调试),它应该工作。
I developed an application that depends on a DLL file. When I debug my application, the applicationwould complain that:
"This application has failed to start because xxx.dll was not found."
So I have to copy the DLL file into the same directory as my .vcproj file.
Is there a way to set the project to look for the DLL file in (preferably) some relative path or (not preferred) some absolute path?
Similar concept to how we set include and library path in the project settings.
I mean when I debug my application (hitting F5) the above error would pop up.
- Go to project properties (Alt+F7)
- Under Debugging, look to the right
- There's an Environment field.
- Add your relative path there (relative to vcproj folder) i.e. ..\some-framework\lib by appending
PATH=%PATH%;$(ProjectDir)\some-framework\lib
or prepending to the pathPATH=C:\some-framework\lib;%PATH%
- Hit F5 (debug) again and it should work.
这篇关于如何在Visual Studio中设置DLL文件的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!