惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Cisco Talos Blog
Cisco Talos Blog
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
D
Docker
Vercel News
Vercel News
IT之家
IT之家
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
腾讯CDC
Google DeepMind News
Google DeepMind News
I
InfoQ
博客园 - 三生石上(FineUI控件)
Apple Machine Learning Research
Apple Machine Learning Research
The GitHub Blog
The GitHub Blog
博客园 - Franky
The Cloudflare Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
T
Tenable Blog
P
Proofpoint News Feed
Recorded Future
Recorded Future
Security Latest
Security Latest
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
博客园 - 聂微东
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
TaoSecurity Blog
TaoSecurity Blog
U
Unit 42
The Hacker News
The Hacker News
Martin Fowler
Martin Fowler
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
F
Full Disclosure
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
Project Zero
Project Zero

博客园 - 松山居士

部署Hermes-Agent和SenseNova-Skills ubuntu用root账户启动服务指定脚本 WSL迁移OpenEuler虚拟机 采用Ollama本地布署DeepSeekCoderV2 Loongnix Server 23.2安装Docker及常用镜像 Ollama导出和导入DeepSeek预训练大模型 Win10上模拟LoongArch虚拟机安装Deepin系统 查看exe启动命令和参数 JMeter做WEB和API自动化测试 PG数据库常用DDL VSCode+XMake开发环境搭建备忘 C++库管理Conan使用备忘 Python多版本管理Anaconda备忘 Win10上模拟LoongArch虚拟机并搭建Qt5开发环境 解决向日葵无人值守自启动的权限问题 强制去掉Qt的运行环境信息 QGIS插件开发备忘 Linux shell 实用命令备忘 WIN10配置FX DocuCentre-IV C2260 PCL6打印机 VMWare虚拟磁盘整理与收缩 解决启用C++17后byte重定义的问题(byte ambiguous ) 解决Deepin安装Flatpak程序时不能创建临时文件的错误
Visual Studio C++设置EXE和DLL在不同路径
松山居士 · 2024-06-04 · via 博客园 - 松山居士

VC++项目生成的exe和dll,一般都会同一个在debug或release目录下,这样可能会造成不同版本第三方库的dll互相冲突的问题,需要将不同版本的dll放到不同的运行目录,让exe程序在运行时自动在指定的目录查找并加载dll。

1、将直接依赖的ConvLibc.dll及它间接依赖的dll放入到./debug/depends目录下。

2、在工程属性页->链接器->输入->延迟加载的DLL项中,将直接引用的DLL名称填入。

 3、在程序代码中设置dll运行路径。注:如果在调试模式出现引用错误,在可将相对路径改为绝对路径。

#include <Windows.h>
#include <libloaderapi.h>

int main()
{
       const char* dllPath = ".\\depends";
       SetDllDirectory(dllPath);
       ......

}