try closing visual studio and delete the obj file. Open Visual Studio and try to debug the app again.
debugging - Error code = 0x80070002
Hello,
i am getting this error message a lot lately. When i try to debug simple simple c++ program. I am new to c++ and learning basics. I tried tried to google it, but didn't find anything, except it could be something with linker.
It says exactly: ERROR: Unable to open file "path to file.obj" Error code = 0x80070002.
I used Visual studio community (in this case 19) many times before and never had this kind of error. I have simply no idea what is causing it.
Thanks for help!
Developer technologies | Visual Studio | Debugging
5 answers
Sort by: Most helpful
-
-
Dylan Zhu-MSFT 6,426 Reputation points
2020-08-31T08:46:01.117+00:00 Hi empleat.
Do you build your project before debugging?
If so, you could go to Project properties->Linker -> Debugging, then set the
Generate Debug Info
toGenerate Debug Information (/DEBUG)
orGenerate Debug Information optimized for sharing and publishing (/DEBUG:FULL)
.Best Regards,
Dylan -
empleat 131 Reputation points
2020-08-31T21:37:59+00:00 That was for what?
Anyway it was set already to first option, i tried the second and same error.
THIS IS FROM OUTPUT WINDOW - DEBUG:
'auto formating.exe' (Win32): Loaded 'D:\files\dev\language\c++\testing\autoformating\auto formating\Debug\auto formating.exe'. Symbols loaded. 'auto formating.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. 'auto formating.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. 'auto formating.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. 'auto formating.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. 'auto formating.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. 'auto formating.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Error: Unable to open file D:\files\dev\language\c++\testing\autoformating\auto formating\auto formating\Debug\auto formating.obj. Error code = 0x80070002.Error: Could not find 'D:\files\dev\language\c++\testing\autoformating\auto formating\auto formating\Debug\auto formating.obj'. auto formating.exe was built with /DEBUG:FASTLINK which requires object files for debugging. The thread 0x2740 has exited with code 0 (0x0).
I usually just debug program, but sometimes, there is need to build program i think. I remember, i read somewhere to do that, when i had some error.
-
empleat 131 Reputation points
2020-11-06T14:20:35.22+00:00 Bump, could anyone help. It is annoying when you try to compile program and each time it gives you this error pop out window!
-
ismael lesaffre 1 Reputation point
2021-03-17T17:36:55.267+00:00 bonjour, j'ai aussi le même problème, le même message et code d'erreur ainsi que la même fenêtre de sortie (exactement les mêmes phrases d'erreur que empleat-6716a) et c'est aussi quand j'essaye de deboguer