如何将命令行参数传递给Gnat-GPS的Build> Run命令构建的可执行文件?

时间:2015-07-16 14:15:19

标签: ada gnat-gps

Step 9 of the GPS tutorial

It is now time to run the application: select the menu Build->Run->sdc, which
will open a dialog window.  In the text input field (selected by default),
press the right arrow key and then insert input.txt: this is the name of a
text file that will be passed as argument to the sdc program.

The text input should now read: %E input.txt and the full command that will be executed is displayed underneath: .../gps/tutorial/obj/sdc input.txt

实际上,这样做会产生错误:

gprbuild: "c:\gnat\2015\share\examples\gps\tutorial\obj\sdc" is not a source of any project.

为构建的可执行文件传递命令行参数的语法是什么?

我尝试了各种宏和参数组合到gprbuild。遵循说明的默认值为%builder -d %eL -P%PP %X %T %E input.txt。我确保%E引用的目录中存在“input.txt”。我可以在命令行上运行sdc input.txt,这样可以正常工作。

1 个答案:

答案 0 :(得分:0)

您显然正在运行“build”命令(通过gprbuild),而不是运行“sdc”可执行文件本身。我猜你选错了菜单。