Hello. I'm trying to use GetUserName function from Windows API. I use C/C++ Runner and I have it set up to work with MSVC. However, I get an error with this particular program:
username.obj : error LNK2019: unresolved external symbol __imp_GetUserNameA referenced in function main
.\build\Debug\outDebug.exe : fatal error LNK1120: 1 unresolved externals
I assume what I need to do is link against Advapi32.lib library, however, when I specify it in Linker Args in user settings (with and without preceding /l), I still get the same error. I assume linker args are not applied to MSVC?
Hello. I'm trying to use GetUserName function from Windows API. I use C/C++ Runner and I have it set up to work with MSVC. However, I get an error with this particular program:
I assume what I need to do is link against Advapi32.lib library, however, when I specify it in Linker Args in user settings (with and without preceding
/l
), I still get the same error. I assume linker args are not applied to MSVC?The code in question: