“功能没有地址”尽管禁用了优化(/ Od) [英] "Function has no address" despite disabled optimization (/Od)

查看:94
本文介绍了“功能没有地址”尽管禁用了优化(/ Od)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MSVC 2012中进行调试期间,我试图从监视窗口调用某些功能,以便将数据转储到文件中。但是,我一直收到此错误:

During debug in MSVC 2012, I am attempting to call some functions from the Watch window in order to dump data to files. However, I keep getting this error:

Function Matrix::Save has no address, possibly due to compiler optimizations.   

Matrix 类位于我自己的外部库。快速检查表明,外部库中的任何方法都没有地址,并且所有从Watch调用它们的尝试均会返回此错误,但头文件中定义的方法除外。无论在何处定义,主项目中的方法都具有地址。

The class Matrix is located in my own external library. A quick check showed that none of the methods in external libraries have addresses and all attempts to call them from Watch return this error, except for those which are defined in the header files. The methods in the main project all have addresses regardless of where they are defined.

当然,在整个解决方案中都禁用了优化。符号已正常加载。

Optimization is disabled throughout the solution, of course. Symbols are loaded normally. How do I fix it?

推荐答案

到目前为止,我发现了一种静态构建外部库的解决方法。使用静态链接库,可以找到方法的地址。配置管理器允许轻松地为发布保留动态库。

So far, I found a workaround in building the external library statically. With statically linked libraries, the addresses of methods are found. Configuration manager allows keeping dynamic libraries for the Release easily.

这篇关于“功能没有地址”尽管禁用了优化(/ Od)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆