[英]How can I make my application find a third-party DLL using Visual Studio?
I have read many issues regarding and followed each one but nothing seems to work. 我已经阅读并关注了许多问题,但似乎无济于事。
I am trying to include the rdkafka library into my project, but every time I run the application I am getting 我试图将rdkafka库包含到我的项目中,但是每次运行该应用程序时,我都会得到
The program can't start because librdkafka.dll is missing from your computer.
该程序无法启动,因为您的计算机缺少librdkafka.dll。
I can clearly see that librdkafka.dll
as well as librdkafka.lib
exist in the same directory. 我可以清楚地看到
librdkafka.dll
和librdkafka.lib
存在于同一目录中。 I have added the include files to the project, and I have also added the librdkafka.lib
to the additional directories in the Linker section. 我已将包含文件添加到项目中,并且还将
librdkafka.lib
添加到链接器部分中的其他目录中。 The project builds fine but it throws that error at runtime. 该项目构建良好,但在运行时抛出该错误。
Does anyone know how I can solve this issue? 有谁知道我该如何解决这个问题?
When in Visual Studio by default it is searching for dlls in the project directory and running the application on its own will try to find the dlls in the current working directory. 默认情况下,在Visual Studio中时,它将在项目目录中搜索dll,然后单独运行该应用程序将尝试在当前工作目录中查找这些dll。 Moving the dlls to this location seems to solve the issue.
将dll移到此位置似乎可以解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.