当前位置:网站首页>动态库*.dll文件的Debug/Release版本是否可以混用(交叉用)?
动态库*.dll文件的Debug/Release版本是否可以混用(交叉用)?
2022-07-23 14:13:00 【libaineu2004】
1、现象:
使用一些第三方的dll,比如opencv,会分别生成debug和release的dll,在exe中必须要引用指定版本的dll,不能混用,否则会出错;
但是还有一些第三方的dll,比如halcon,只提供给用户release的dll,用户的debug版和release版的exe都可以引用此dll。
如此看来,是有些dll可以混用(交叉引用),有些不可以,两者为什么会存在差异?
2、原因
比如debug的exe调用release编译生成的dll,接口函数的参数如果使用std::vector或者std::string之类的东西,肯定会崩。因为stl在release和debug下实现不同。std::string在debug和release环境中的内存大小是不一致的。 如果混用,会出现内存奔溃现象。
3、结论
不含stl库的debug动态库和release动态库在debug或release项目中都可以使用;
含有stl的debug动态库和release动态库在项目中不能混用,debug项目必须用debug库, release 项目必须用release库 ;
内存谁分配谁释放,动态库导出函数不要用stl,仅使用基本类型或接口;
4、参考文献
边栏推荐
- Object.defineproperty method, data agent
- Weisfeiler-Lehman图同构测试及其他
- Scale Match for Tiny Person Detection
- Leetcode-168.excel table column name
- 解决data functions should return an object 并(Property “visible“ must be accessed with “$data.visible“)
- Opencv open camera, edge detection
- C语言基础篇 —— 2-6 指针、数组与sizeof运算符
- PMP每日一练 | 考试不迷路-7.23
- ROS2自学笔记:RQT可视化工具
- 软件配置 | Pycharm下载、安装及环境配置和卸载
猜你喜欢

【Web漏洞探索】SQL注入漏洞

SSD: Single Shot MultiBox Detector

Pinduoduo app product details interface to obtain activity_ ID value (pinduoduo activity_id interface)

Using "soup.h1.text" crawler to extract the title will be one more\

ROS2自学笔记:RQT可视化工具

通过SSH方式访问内网RDS+mysql

UPC 2022暑期个人训练赛第12场(B 组合数)
![[30. N-queen problem]](/img/ed/7e2832695613c16da034f05bd4040b.png)
[30. N-queen problem]

CSR、SSR 与 SSG

Notes on Microcomputer Principle and technical interface
随机推荐
PIP reports an error could not find a version that satisfies the... No matching distribution
Advanced authentication of uni app [Day12]
Add dependent jar packages to the project in the idea
系统内存介绍和内存管理
AutoCAD进阶操作
MySQL 啥时候用表锁,啥时候用行锁?
VSCode PIO创建工程失败分析和解决办法
Récursion des bosses 1: formule récursive
软件质量体系之思
已解决(selenium 操作火狐Firefox浏览器报错)AttributeError: ‘WebDriver’ object has no attribute ‘execute_cdp_cmd’
CSR、SSR 与 SSG
Pinduoduo app product details interface to obtain activity_ ID value (pinduoduo activity_id interface)
本周投融报:Web3游戏熊市吸金
泰山OFFICE技术讲座:段落边框的布局绘制分析
Notes on Microcomputer Principle and technical interface
Win11如何添加图片3D效果?Win11添加图片3D效果的方法
JS之闭包
微机原理与技术接口课后作业总结
【mysql集群故障恢复】
无心剑英汉双语诗006.《致爱妻》