fatal error LNK1104: cannot open file 'C:\Program.obj'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 2abstract12
    New Member
    • Oct 2008
    • 1

    #1

    fatal error LNK1104: cannot open file 'C:\Program.obj'

    Hi

    I am trying to build a bluetooth application to send and recieve data using microsoft sample code. When i compile the code, there are no error but when i try to build one i am getting this strange link error.

    I am using Visual 2008 on Vista. My file path is \Documents\Visu al Studio 2008\a1\a1\Debu g.

    Additional dependencies --- $(WindowsSdkDir ).


    I did google the error and there are suggestions to put the path name in brackets. I am not sure how to do it but i believe that path name cannot be an issue since i am using the default settings of Visual 2008.

    Following is the code I am using right now.

    <Complete code snipped>

    Thank you for your help.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Please read our posting guidelines we do not allow posting of your entire code. Additionally in this particular case all that code just detracts from the problem which is not related to your code.

    It is a linker error, it is failing to open some file that has been placed on the command link of the link command.

    The file was probably in a sub-directory of Program Files. As you original investigation suggested because of the space c:\Program Files\<...> was being interpreted as C:\Program.obj, an object to include in the link.

    You need to put " round the file path on the command line that is located in Program Files so that c:\Program Files\<...> is interpreted as "c:\Program Files\<...>"

    Comment

    Working...