LNK1106 error trashing sourcefiles? RRS feed

  • Question

  • HI,

    I believe I have encounter a serious problem that really scared me!
    I am working on implementing a fat filesystem for another os and doing so I
    generated some images by formatting some MMC cards and the ripped those images
    into files so I could work with them.

    I am developing this using two setups one at work with XP and visual studio 2008 and one
    at home with win 2000 and visual studio 2005 ( perhaps 2003 ?). The one that require the bufferoverflowu.lib.

    Bringing the project home and as it has happen before I forgot to use the /all switch with nmake and so I got a
    linker error. I usually get the unresolved symbol error asking for security cookies etc. And I solve that with adding
    the bufferoverflowu.lib to the linker line.

    This time however I got the LNK1106 error stating that It could not seek to some position. I used the /all switch again
    with nmake to rebuild all the obj files and I could continue working with the project.

    Now friday morning I am back at work and doing a new rebuild this time on visual 2008. And the compiler complains
    about some syntax error in a source file utils.cpp. I was very surprised since I haven't tuched that file for weeks!

    I opened it up and found some printf outputs that came from my informational output in the project.

    First to say is that I am not doing any redirection my self. The only file my own project open is the image file.

    How is it possible that my printf outputs ends up in one of my source files?

    I am now guessing here. Since the object files was generated on visual 2008 and then it was provided to the
    2005 linker some compatibility errors may very well be expected. The issue here is however what happend next?
    Have the linker left some stdout redirection pointing somewere randomly? The file utils.cpp was the last file in the
    makefile so it is possible that is still was memory mapped.

    Does anyone else have an idea of what could have happened?

    A console applications stdout shouldn't go to some memory mapped file? This is severe!

    Jonny Fransson

    • Edited by Wuffo Friday, January 22, 2010 9:11 AM Spelling
    Friday, January 22, 2010 9:09 AM

All replies

  • If you can get the issue to reproduce reliably then I would encourage that you post the issue to Microsoft Connect.  We would be very interested to take a look.
    SDET Windows C++ CodeGenerationTeam - Performance
    Wednesday, November 17, 2010 9:18 AM