Visual Studio: LINK : fatal error LNK1181: cannot open input file

后端 未结 17 2816
盖世英雄少女心
盖世英雄少女心 2020-12-05 03:47

I\'ve been encountering a strange bug in Visual Studio 2010 for some time now.

I have a solution consisting of a project which compiles to a static library, and anot

17条回答
  •  再見小時候
    2020-12-05 04:32

    I had the same error when running lib.exe from cmd on Windows with a long argument list. apparently cmd.exe has max line length of about 8K characters, which resulted that the filenames at the end of this threshold got changed, thus resulting in bad filename error. my solution was to trim the line. I removed all paths from filenames and added single path using /LIBPATH option. for example:

    /LIBPATH:absolute_path /OUT:outfilename filename1.obj filename2.obj ... filenameN.obj
    

提交回复
热议问题