VS immediate window “identifier undefined” when querying DLL functions w/ namespace

给你一囗甜甜゛ 提交于 2020-05-17 05:23:47

问题


I have some DLL exported functions that I'm trying to call from inside of VS2017 immediate window. The functions in the C++ header look like this:

namespace ma
{
    bool MODEL_DECLSPEC ClearParameter();
    bool MODEL_DECLSPEC GetResult();
          :
}

However, when I stop at a breakpoint in my code and type into the immediate window

ma::GetResult()

It returns

 identifier "ma" is undefined

I can call functions in the "std" namespace but not in my own namespace?

EDIT: I did some more tests and the immediate window interprets the "ma" namespace fine and calls my exported DLL function when my breakpoint is within the "ma" namespace scope inside the DLL. That's pretty limiting for debugging, so I'm sure I'm missing something?


回答1:


Found out it had nothing to do with namespace. The native debugger won't look outside of its current module: "Immediate window can not execute a function exported by a dll"

There are some workarounds discussed here



来源:https://stackoverflow.com/questions/50336610/vs-immediate-window-identifier-undefined-when-querying-dll-functions-w-namesp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!