0

C++Builder XE5 のコマンドライン ツールを使用してプロジェクトをビルドしていますが、オブジェクト ファイルが多すぎるため、出力は次のようになります。

MAKE Version 5.4  Copyright (c) 1987, 2010 Embarcadero Technologies, Inc.
    ilink64 ...........

Fatal: Command arguments too long

この問題を回避するにはどうすればよいですか?

(メタノート:私は自分の質問に答えようとしていますが、公式ドキュメントがあまり明るくないため、これを理解するのに時間がかかりました。同じ問題を抱えている他の人に役立つ場合に備えて、このQAを投稿しています)

4

1 に答える 1

0

Example syntax for creating and using a response file in the makefile:

myproject.dll: $(MANYOBJECTS)
    ilink64 $(LINKER_FLAGS) @&&.
$(MANYOBJECTS), myproject.dll, , import64 cw64mt
.

The key ideas are:

  • the character immediately following the && is the character to be used as delimiter, other delimiters besides . are possible
  • the text between the two .'s is expanded and placed in a temporary file
  • The closing delimiter must be the first character on its line
  • the temporary filename takes the place of the &&.....
  • Anything after the opening delimiter on the same line is ignored
  • The @ means that ilink64 will treat the contents of the temporary file as a response file, as opposed to treating it as an object file
  • Anything after the response file is actually ignored by ilink64 despite correctly appearing in the command output (don't know why; but this means you have to make the response file contain the entire remainder of the command).

The command generated by this example was:

MAKE Version 5.4  Copyright (c) 1987, 2010 Embarcadero Technologies, Inc.
    ilink64 -q -aa -Tpd -x -Gn c0x64 @MAKE0000.@@@

(note: my linker flags may be incorrect, this is just a demonstration of how the response file works).

于 2014-06-12T01:09:03.133 に答える