none
Error_1_fatal error LNK1104: cannot open file '.\Debug\stdafx.obj'_1_1 RRS feed

  • Question

  • Hello ,

    I wrote a simple Hello world program. I get this error all the time(also in Visual Studio 2005 and Visual Studio 2008):

    Error    1    fatal error LNK1104: cannot open file '.\Debug\main.obj'    2    2

    Where main is the simple hello world program, whether it's C++ or C. I tried reinstalling many times. No luck.

    I also tried following some of the indications on the site, but nothings works.

    I will also put here the content of the built log and the content of the Linker/ Command line.

    Soo, in the built log i get this:
    Creating temporary file "c:\Documents and Settings\simona\Desktop\C programming\test\test\Debug\RSP00000631321764.rsp" with contents
    [
    /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /c /ZI /TP ".\t.cpp"
    ]
    Creating command line "cl.exe @"c:\Documents and Settings\simona\Desktop\C programming\test\test\Debug\RSP00000631321764.rsp" /nologo /errorReport:prompt"
    Creating temporary file "c:\Documents and Settings\simona\Desktop\C programming\test\test\Debug\RSP00000731321764.rsp" with contents
    [
    /OUT:"C:\Documents and Settings\simona\Desktop\C programming\test\Debug\test.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\test.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Documents and Settings\simona\Desktop\C programming\test\Debug\test.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

    ".\Debug\t.obj"

    ".\Debug\test.exe.embed.manifest.res"
    ]
    Creating command line "link.exe @"c:\Documents and Settings\simona\Desktop\C programming\test\test\Debug\RSP00000731321764.rsp" /NOLOGO /ERRORREPORT:PROMPT"
    Output Window
       
    Compiling...
    Linking...
    LINK : fatal error LNK1104: cannot open file '.\Debug\t.obj'

    And in the Linker/ Command Line i have this:

    /OUT:"C:\Documents and Settings\simona\My Documents\Visual Studio 2008\Projects\2\Debug\2.exe" /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\2.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Documents and Settings\simona\My Documents\Visual Studio 2008\Projects\2\Debug\2.pdb" /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib


    Also, if i follow the indications on msdn, on creating a new simple program using Visual studio Command prompt, i observed that the command: " CL filename.cpp " it doesn't do anything. I get no errors, still no executable, nothing.

    Help , please??

    Thanks
    Thursday, February 18, 2010 5:02 PM

Answers

  • Hi,

    Please check Linker Tools Error LNK1104 in MSDN. Maybe it helps.

    And I would suggest you removing the setting in Object File Name box under Project Properties > Configuration Properties > C/C++ > Output Files . If this is not in the case, please try to close antivirus software, and try again.

    Best Regards,

    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Thursday, February 25, 2010 2:34 AM
    Monday, February 22, 2010 8:47 AM

All replies

  • You are in your user directories I never do that!
     Have you tried making a project directory on your C:\ hard drive.
    example:
    C:\my_projects
    The reason is that sometimes visual studio 2005 will not read or write to a folder if the path is to long!
    This has happened to me many time which is annoying.
    Thursday, February 18, 2010 7:20 PM
  • Hi,

    Please check Linker Tools Error LNK1104 in MSDN. Maybe it helps.

    And I would suggest you removing the setting in Object File Name box under Project Properties > Configuration Properties > C/C++ > Output Files . If this is not in the case, please try to close antivirus software, and try again.

    Best Regards,

    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Thursday, February 25, 2010 2:34 AM
    Monday, February 22, 2010 8:47 AM
  • Go to the following path                                                                                                               project -> properties -> c/c++ -> Generate preprocessed file
    just set it as NO                                                                                                                                 I have got the same problem but doing this i get resolved(if you were building your project in debug mode)

    or if you would try to build your project in release mode then the error will not come . you 'll get executable successfully.

    Tuesday, June 7, 2011 8:17 AM
  • Thank you,,, you 100% right

     

    its working.

    You are in your user directories I never do that!
    Have you tried making a project directory on your C:\ hard drive.
    example:
    C:\my_projects
    The reason is that sometimes visual studio 2005 will not read or write to a folder if the path is to long!
    This has happened to me many time which is annoying.

    • Edited by wahab759 Friday, October 14, 2011 6:27 PM
    Friday, October 14, 2011 6:26 PM