debugging - Error code = 0x80070002

empleat 131 Reputation points
2020-08-29T23:33:49.837+00:00

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
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Ken Tucker 5,861 Reputation points
    2020-08-30T19:41:55.583+00:00

    try closing visual studio and delete the obj file. Open Visual Studio and try to debug the app again.

    1 person found this answer helpful.
    0 comments No comments

  2. 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 to Generate Debug Information (/DEBUG) or Generate Debug Information optimized for sharing and publishing (/DEBUG:FULL).

    21521-annotation-2020-08-31-10262392238.jpg

    Best Regards,
    Dylan

    1 person found this answer helpful.
    0 comments No comments

  3. 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.

    1 person found this answer helpful.

  4. 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!

    0 comments No comments

  5. 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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.