Thread: Linker error in C

  1. #1
    Registered User
    Join Date
    Feb 2008
    Posts
    10

    Question Linker error in C

    Good day everyone, i have a C code in which while compiling i get the below error...
    Code:
    ------ Build started: Project: Biodata, Configuration: Debug Win32 ------
    Compiling...
    Biodata_main.c
    Biodata_mcc_component_data.c
    Generating Code...
    Linking...
    LINK : fatal error LNK1104: cannot open file 'D:\Documents.obj'
    Build log was saved at "file://d:\Documents and Settings\olawale\Desktop\Bioinformatics 10th march\Biodata\Biodata\Biodata\Debug\BuildLog.htm"
    Biodata - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    can anyone please suggest what to do

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    You must have a project in the solution that either creates the documents.obj or relies on it somehow. The linker cannot open it. It is either in use already or it cannot find it. Restart Visual Studio, clean, rebuild, and run it. If you get the same error then check your project settings. You may need to specify the intermediate directory in your debugging options.

  3. #3
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    that either creates the documents.obj or relies on it somehow.
    I do not think this is the case...

    Seems like linker wants to find some file like
    d:\Documents and Settings\olawale\Desktop\Bioinformatics 10th march\Biodata\Biodata\Biodata\Debug\obj\...

    and instead takes only the path till the first space...

    Probably - missing "" around some path

    PS. You can try to take the last Biodata folder - containing the project, move it to D:\ and try to compile from that location...
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Perhaps but hard to diagnose without more info or being there. Linker errors are never fun.

  5. #5
    Registered User
    Join Date
    Feb 2008
    Posts
    10
    thanks everyone for the prompt response, i'll try to what ya'll gave and get back to you guyz...thanks so much..bye

  6. #6
    Registered User
    Join Date
    Feb 2008
    Posts
    10
    guyz it aint working...already tried all what you did...do i post the code here instead???

  7. #7
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by walataza View Post
    guyz it aint working...already tried all what you did...do i post the code here instead???
    I doubt code will help - it is something with linker settings

    What IDE you are using?

    Could you go to the Project/Settings/Link and copy the command line switches from there?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  8. #8
    Registered User
    Join Date
    Feb 2008
    Posts
    10
    I'm using visual studio 2008, was having problems using visual c++ 6 was why i switched to this...below is the command line switch you asked for
    /OUT:"D:\Documents and Settings\olawale\Desktop\Bioinformatics 10th march\Biodata\Biodata\Debug\Biodata.exe" /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\Biodata.exe.intermediate.manif est" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"D:\Documents and Settings\olawale\Desktop\Bioinformatics 10th march\Biodata\Biodata\Debug\Biodata.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT D:\Documents and Settings\olawale\Desktop\Bioinformatics 10th march\Biodata\distrib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

  9. #9
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Not sure where it comes from, but I'm 99.9% sure that this is what's causing the problem.

    Code:
    D:\Documents and Settings\olawale\Desktop\Bioinformatics 10th march\Biodata\distrib
    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  10. #10
    Registered User
    Join Date
    Feb 2008
    Posts
    10
    so what do you think i should do??? cos this path you just mentioned is where my CTF files to run the application(included files) are located..any help'll be appreciated

  11. #11
    Registered User
    Join Date
    Feb 2008
    Posts
    10
    i agree wit u matsp..i copied the CTF(common technology file)which is an extractable .exe file to my d drive and this is the error that i got

    ------ Build started: Project: Biodata, Configuration: Debug Win32 ------
    Linking...
    LINK : fatal error LNK1104: cannot open file 'D:\.obj'
    Build log was saved at "file://d:\Bioinformatics 10th march\Biodata\Biodata\Biodata\Debug\BuildLog.htm"
    Biodata - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    but before it was document.obj that was missing....now its just .obj it cant find..any idea??

  12. #12
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    My immediate suggestion would be to move your entire project to a directory/path that doesn't have spaces in it. D:\documents and settings\ isn't a good place, in my opinion, to put things in the first place, but that may be just me.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  13. #13
    Registered User
    Join Date
    Feb 2008
    Posts
    10
    i just noticed something matsp,when the projects were in my documents, it was asking for a document.obj,then i moved it to c:/ which is my datafiles(OS on d:/) then it kept bringing the error .obj...now i created a folder on c:/ which is called Biodata, now its tellin me its looking for Biodata.obj..any hint pls??

  14. #14
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    some space in the linker options string is enterpreted as obj-file name
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  15. #15
    Registered User
    Join Date
    Feb 2008
    Posts
    10
    hello vart...so wot do i do as regards what you just said???

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linker problem... no idea
    By cyreon in forum C Programming
    Replies: 2
    Last Post: 04-03-2009, 02:53 PM
  2. linker
    By George2 in forum C++ Programming
    Replies: 6
    Last Post: 02-23-2008, 01:25 AM
  3. Linker errors in VC++ 2005
    By C+/- in forum C++ Programming
    Replies: 0
    Last Post: 05-18-2007, 07:42 AM
  4. Linker errors when compiling
    By The Wazaa in forum C++ Programming
    Replies: 4
    Last Post: 10-07-2006, 12:55 PM
  5. MSVis-Studio C++ libraries and linker errors
    By kellydj in forum Windows Programming
    Replies: 10
    Last Post: 03-12-2002, 02:03 PM