问题
I know some linkers have a limit of how many object files are allowed on the command line. What is Visual Studio's? Also, if you exceed this number, some linkers allow you to specify a file containing the name of all the object files, and you would only pass that as an argument. Here's an example to show you what I mean:
some_linker file1.o file2.o ... file9000.o -out=some.lib
Suppose 9000 is too much for this linker, but it allows you to write the path to the objects in another file, example.txt:
file1.o
file2.o
...
file9000.o
And the linker call becomes:
some_linker -input=example.txt -out=some.lib
How is Visual Studio behaving in this situation? Does it allow for something like this?
回答1:
The maximum number of arguments doesn't appear to be specified in that portion of the documentation. I'm not sure if this is provided elsewhere, but I personally haven't seen it.
However, link.exe does allow you to specify a text file containing the name of all the object files, which it calls a "command file". According to the documentation, you specify a command file by prepending its filename with an at sign:
LINK @commandfile
The arguments in the command file can be separated by either spaces or tabs (as on the command line) and by newline characters.
来源:https://stackoverflow.com/questions/4689510/what-is-the-link-file-limit-using-visual-studios-link-exe