简体   繁体   中英

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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM