locked
Help needed, fatal error LNK1104: cannot open file 'Debug\\.obj'

    Question

  • I'm trying to build an assembly project but I'm getting the following error:

    ------ Build started: Project: Chapter2_Exercise5, Configuration: Debug Win32 ------
      Assembling [Inputs]...
    LINK : fatal error LNK1104: cannot open file 'Debug\\.obj'
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

     

    Here is what I've done so far...


    1) First, I have verified that Microsoft Assembler is installed because ml.exe is in "C:\Program Files\Microsoft Visual Studio 10.0\VC\bin"

    2) I have downloaded and installed MASM32 SDK

    3) Under Properties/Configuaration Properties/VC++ Directories/Include Directories, I
    have entered "C:\Documents and Settings\*****\My Documents\Guide to Assembly Language, A Concise Introduction", because that is where my Chapter1_2.7EX5.asm file is located.

    4) Also under Properties/Configuaration Properties/VC++ Directories/Include Directories, I have entered "C:\masm32\include"

    5) Under Properties/Configuaration Properties/VC++ Directories/Library Directories, I have entered "C:\masm32\lib"

    6) Under Properties/Configuaration Properties/Linker/General/Additional Library Directories, I have entered "C:\masm32\include;C:\masm32\lib;C:\masm32\macros"

    7) Under Properties/Configuaration Properties/Linker/Input/Additional Dependencies, I have entered in "msvcrt.lib"

    8) Under Properties/Configuaration Properties/Linker/System/SubSystem,  I have entered in "Windows (/SUBSYSTEM:WINDOWS)"

    9) Under Properties/Configuaration Properties/Linker/Advanced/Entry Point, I have entered in "main"

    10) Under Properties/Configuaration Properties/Custom Build Setup/General/Command Line, I have keyed in: ml -c -Zi "-Fl$(IntDir)\$(InputName).lst" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)"

    11) Under Properties/Configuaration Properties/Custom Build Setup/General/Outputs, I have keyed in: $(IntDir)\$(InputName).obj

     

     

    Also, here are the contents of C:\Documents and Settings\*****\My Documents\Guide to Assembly Language, A Concise Introduction\Chapter2_Exercise5\Chapter2_Exercise5\Debug\Chapter2_Exercise5.txt   ...

    Build started 9/15/2012 5:24:38 PM.
    Project "C:\Documents and Settings\*****\My Documents\Guide to Assembly Language, A Concise Introduction\Chapter2_Exercise5\Chapter2_Exercise5\Chapter2_Exercise5.vcxproj" on node 2 (build target(s)).
    InitializeBuildStatus:
      Touching "Debug\Chapter2_Exercise5.unsuccessfulbuild".
    _MASM:
      Assembling [Inputs]...
      cmd.exe /C "C:\Documents and Settings\*****\Local Settings\Temp\90c51a4d8f3d4700a952968dc431231f.cmd"
      ml.exe /c /nologo /Zi /Fo"Debug\Chapter1_2.7EX5.obj" /W3 /errorReport:prompt  /Ta..\..\Chapter1_2.7EX5.asm
    Link:
      c:\Program Files\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\Documents and Settings\*****\My Documents\Guide to Assembly Language, A Concise Introduction\Chapter2_Exercise5\Debug\Chapter2_Exercise5.exe" /NOLOGO /LIBPATH:C:\masm32\include /LIBPATH:C:\masm32\lib /LIBPATH:C:\masm32\macros kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib msvcrt.lib /MANIFEST /ManifestFile:"Debug\Chapter2_Exercise5.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Documents and Settings\*****\My Documents\Guide to Assembly Language, A Concise Introduction\Chapter2_Exercise5\Debug\Chapter2_Exercise5.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /ENTRY:"main" /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Documents and Settings\*****\My Documents\Guide to Assembly Language, A Concise Introduction\Chapter2_Exercise5\Debug\Chapter2_Exercise5.lib" /MACHINE:X86 Debug\\.obj
      Debug\Chapter1_2.7EX5.obj
    LINK : fatal error LNK1104: cannot open file 'Debug\\.obj'
    Done Building Project "C:\Documents and Settings\*****\My Documents\Guide to Assembly Language, A Concise Introduction\Chapter2_Exercise5\Chapter2_Exercise5\Chapter2_Exercise5.vcxproj" (build target(s)) -- FAILED.

    Build FAILED.

    Time Elapsed 00:00:02.20

     


    My only guess is that something must be keyed in under Properties/Configuaration Properties/Microsoft Macro Assembler

    Somebody please tell me what I am doing wrong.

    Sunday, September 16, 2012 1:32 AM

Answers

  • I'm trying to build an assembly project but I'm getting the following error:

    ------ Build started: Project: Chapter2_Exercise5, Configuration: Debug Win32 ------
      Assembling [Inputs]...
    LINK : fatal error LNK1104: cannot open file 'Debug\\.obj'
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

     

    Here is what I've done so far...


    Good Grief! You certainly make it all look very complicated!

    >Under Properties/Configuaration Properties/VC++
    > Directories/Include Directories, I have entered
    > "C:\Documents and Settings\*****\My Documents\Guide to Assembly
    > Language, A Concise Introduction", because that is where my
    > Chapter1_2.7EX5.asm file is located.

    That setting is for the path(s) to the *header* files,
    not the *source* files. e.g. - Where the *.inc, *.h,
    etc. files are located, not the *.asm, *.cpp, etc.
    files. (They *may* be in the same directory.)

    >Under Properties/Configuaration Properties/Linker/General/Additional
    >Library Directories, I have entered
    >"C:\masm32\include;C:\masm32\lib;C:\masm32\macros"

    That property should only have *library* directories listed.
    Why did you put the paths to the headers and macros in there
    as well?

    >Under Properties/Configuaration Properties/Linker/System/SubSystem,  
    >I have entered in "Windows (/SUBSYSTEM:WINDOWS)"

    That's probably wrong. You probably should have chosen
    /SUBSYSTEM:CONSOLE

    >Under Properties/Configuaration Properties/Custom Build
    >Setup/General/Outputs, I have keyed in:
    >$(IntDir)\$(InputName).obj

    Which may be where your problem is located. You really didn't
    need to put anything there.

    >Under Properties/Configuaration Properties/Linker/Advanced/Entry
    >Point, I have entered in "main"

    Probably unnecessary.

    -------------------------------

    I'm not even going to try to untangle that mess. Instead, let
    me describe the steps I just took using VC++ 2008 Express to
    build one of the examples from your referenced site.

    (1) Downloaded the source code and libs for VC++ 2008
    from here:  http://kipirvine.com/asm/examples/index.htm
    Extracted files to C:\Irvine

    (2) Created a new project in VC++ 2008 using the Project
    Template for "Win32 Console Application". UNchecked
    "Precompiled header" and checked "Empty project".

    (3) Right clicked on "Source Files" in the Solution Explorer
    window and chose "Add->Existing Item". Navigated to
    C:\Irvine\Examples\ch06\Project\ and selected main.asm

    (4) Right-clicked on the project name in the Solution
    Explorer window, clicked on "Custom Build Rules", and
    checked the box to select "Microsoft Macro Assembler".

    (5) Opened the Project Properties and set:

    Configuration Properties->Microsoft Macro Assembler->
    General->Include Paths: (entered) C:\Irvine

    Configuration Properties->Linker->General->Additional
    Library Directories: {entered} C:\Irvine

    Configuration Properties->Linker->Input->Additional
    Dependencies: (entered) Irvine32.lib

    (6) Did a Build. Output window:

    1>------ Build started: Project: MASM test3, Configuration: Debug Win32 ------
    1>Assembling...
    1> Assembling: ..\..\..\..\..\..\..\Irvine\Examples\ch06\Project\main.asm
    1>Compiling manifest to resources...
    1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    1>Copyright (C) Microsoft Corporation.  All rights reserved.
    1>Linking...
    1>Embedding manifest...
    1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    1>Copyright (C) Microsoft Corporation.  All rights reserved.
    1>Build log was saved at "file://c:\Documents and Settings\...\My Documents\Visual Studio 2008\Projects\MASM test3\MASM test3\Debug\BuildLog.htm"
    1>MASM test3 - 0 error(s), 0 warning(s)
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    

    (7) Ran it with breakpoint at "exit". Contents of console window:

    MASM program example

    - Wayne

    • Marked as answer by Huaysepfan87 Sunday, September 16, 2012 3:39 PM
    Sunday, September 16, 2012 4:36 AM

All replies

  • I'm trying to build an assembly project but I'm getting the following error:

    ------ Build started: Project: Chapter2_Exercise5, Configuration: Debug Win32 ------
      Assembling [Inputs]...
    LINK : fatal error LNK1104: cannot open file 'Debug\\.obj'
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

     

    Here is what I've done so far...


    Good Grief! You certainly make it all look very complicated!

    >Under Properties/Configuaration Properties/VC++
    > Directories/Include Directories, I have entered
    > "C:\Documents and Settings\*****\My Documents\Guide to Assembly
    > Language, A Concise Introduction", because that is where my
    > Chapter1_2.7EX5.asm file is located.

    That setting is for the path(s) to the *header* files,
    not the *source* files. e.g. - Where the *.inc, *.h,
    etc. files are located, not the *.asm, *.cpp, etc.
    files. (They *may* be in the same directory.)

    >Under Properties/Configuaration Properties/Linker/General/Additional
    >Library Directories, I have entered
    >"C:\masm32\include;C:\masm32\lib;C:\masm32\macros"

    That property should only have *library* directories listed.
    Why did you put the paths to the headers and macros in there
    as well?

    >Under Properties/Configuaration Properties/Linker/System/SubSystem,  
    >I have entered in "Windows (/SUBSYSTEM:WINDOWS)"

    That's probably wrong. You probably should have chosen
    /SUBSYSTEM:CONSOLE

    >Under Properties/Configuaration Properties/Custom Build
    >Setup/General/Outputs, I have keyed in:
    >$(IntDir)\$(InputName).obj

    Which may be where your problem is located. You really didn't
    need to put anything there.

    >Under Properties/Configuaration Properties/Linker/Advanced/Entry
    >Point, I have entered in "main"

    Probably unnecessary.

    -------------------------------

    I'm not even going to try to untangle that mess. Instead, let
    me describe the steps I just took using VC++ 2008 Express to
    build one of the examples from your referenced site.

    (1) Downloaded the source code and libs for VC++ 2008
    from here:  http://kipirvine.com/asm/examples/index.htm
    Extracted files to C:\Irvine

    (2) Created a new project in VC++ 2008 using the Project
    Template for "Win32 Console Application". UNchecked
    "Precompiled header" and checked "Empty project".

    (3) Right clicked on "Source Files" in the Solution Explorer
    window and chose "Add->Existing Item". Navigated to
    C:\Irvine\Examples\ch06\Project\ and selected main.asm

    (4) Right-clicked on the project name in the Solution
    Explorer window, clicked on "Custom Build Rules", and
    checked the box to select "Microsoft Macro Assembler".

    (5) Opened the Project Properties and set:

    Configuration Properties->Microsoft Macro Assembler->
    General->Include Paths: (entered) C:\Irvine

    Configuration Properties->Linker->General->Additional
    Library Directories: {entered} C:\Irvine

    Configuration Properties->Linker->Input->Additional
    Dependencies: (entered) Irvine32.lib

    (6) Did a Build. Output window:

    1>------ Build started: Project: MASM test3, Configuration: Debug Win32 ------
    1>Assembling...
    1> Assembling: ..\..\..\..\..\..\..\Irvine\Examples\ch06\Project\main.asm
    1>Compiling manifest to resources...
    1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    1>Copyright (C) Microsoft Corporation.  All rights reserved.
    1>Linking...
    1>Embedding manifest...
    1>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
    1>Copyright (C) Microsoft Corporation.  All rights reserved.
    1>Build log was saved at "file://c:\Documents and Settings\...\My Documents\Visual Studio 2008\Projects\MASM test3\MASM test3\Debug\BuildLog.htm"
    1>MASM test3 - 0 error(s), 0 warning(s)
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    

    (7) Ran it with breakpoint at "exit". Contents of console window:

    MASM program example

    - Wayne

    • Marked as answer by Huaysepfan87 Sunday, September 16, 2012 3:39 PM
    Sunday, September 16, 2012 4:36 AM
  • Configuration Properties->Microsoft Macro Assembler->
    General->Include Paths: (entered) C:\Irvine

    Configuration Properties->Linker->General->Additional
    Library Directories: {entered} C:\Irvine

    Configuration Properties->Linker->Input->Additional
    Dependencies: (entered) Irvine32.lib
      

    Will this work with VC Express 2010?

    For my project, What exactly needs to be keyed in here? ...

        Configuration Properties->Microsoft Macro Assembler->
        General->Include Paths: (entered)???

        Configuration Properties->Linker->General->Additional
        Library Directories: {entered} ???

        Configuration Properties->Linker->Input->Additional
        Dependencies: (entered) ???

    Sunday, September 16, 2012 2:35 PM
  • Thanks so much!  It builds now.
    Sunday, September 16, 2012 3:39 PM