admin管理员组文章数量:1125557
I am using CMake and Mingw to build my (Qt) project in VSCode under Windows.
Within the build tree, a few more libraries are being built and linked.
And building works.
What does not work however, is actually running the application from the explorer, command line or VSCode, because the (previously linked) libraries are not being found in the execution context.
One possible solution is to create a launch.json
, which adds the Qt folder as well as the respective build folders for the DLLs to the PATH environment variable upon launching.
This however is problematic, because, depending on the build, the (built) dlls may reside in a different path (i.e. release instead of debug). It's also not possible to just click 'run' or 'debug' (because neither would use the launch.json).
In QtCreator, I can automagically add the paths to the linked libraries to the PATH upon execution and I wonder if there's something similar in VSCode.
Alternatively, I'd also be happy to do something similar to what Linux seems to be doing.
When running ldd
on the executable, all .so paths are being resolved correctly, even though they are not set in an environment variable, so I assume that there is some sort of 'hint' within the executable.
The solution only needs to work on the local machine, actual deployment ships the required DLLs in the same folder as the executable.
本文标签: cAutomatically add paths to linked libraries to VSCode executionStack Overflow
版权声明:本文标题:c++ - Automatically add paths to linked libraries to VSCode execution - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736667527a1946743.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论