What is the link file limit using Visual Studio's link.exe?

て烟熏妆下的殇ゞ 提交于 2019-12-24 01:07:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!