如何在 GPS 中运行 Ada 代码
在GNAT编程工作室中,如何运行程序?我看到它编译成功,但我看不到我的程序从哪里开始运行。我想测试一下。
In GNAT Programming Studio, how do you run the program? I see it compiled successfully, but I do not see where my program has started running. I would like to test it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,您必须在项目属性中选择主程序(请参阅“主文件”选项卡)。您实际上可以为多个可执行文件选择多个文件。
接下来,您必须构建它 - 通过按 F4 选择列表中的第一个主文件,或者在“构建”->“项目”子菜单中选择它,或者在“构建”->“项目”子菜单中选择“构建全部”(或使用菜单项的工具栏)。
最后,您可以选择要运行的主文件,方法是在“构建”->“运行”菜单中选择它,或者按 Shift+F2 键选择列表中的第一个文件。在对话框中输入参数,然后按“确定”。
“消息”面板旁边应该有一个新选项卡,其中放置所有输出,您也可以使用它进行输入。您可以在运行对话框中选择使用外部终端。
如果你想调试它,请查看“调试”菜单。阅读文档以获取更多信息。
First, you have to select your Main procedure in the project properties (see the "main files" tab). You can actually choose multiple files for multiple executables.
Next, you have to build it - either by pressing F4 for the first Main File in the list, or by choosing it in the Build->Project submenu, or by choosing "build all" in the Build->Project submenu (or use the toolbar for the menu entries).
Last, you can choose, which of your Main Files to run by choosing it in the Build->Run menu, or by pressing shift+F2 for the first file in the list. Enter the parameters in the dialog and press OK.
There should be a new Tab next to the Messages panel, where all output is placed, and you can use it for input, too. You could choose to use an external terminal in the run dialog.
If you want to debug it, have a look at the Debug menu. Read the documentation for more information.
最后,您可以通过在“构建”->“运行”菜单中选择要运行的主文件,或者按 Shift+F2 键选择列表中的第一个文件。在对话框中输入参数,然后按“确定”。
无论我在此处输入什么,例如项目名称,
Primes_Count
或我看到的“可执行文件”的名称,< code>Primes_Count.o,它只是不运行。我在消息窗口中得到此消息输出:
我不明白为什么 Ada 在“运行”步骤中如此重视。
如果在制作 .o 文件和完成的 Ada 可执行文件之间还有另一个阶段,那么 GPS 系统肯定可以自行处理。 。 。
十二月。
现在好了,排序了。 GPS 面板管理此 [ 项目菜单 >编辑项目道具>主文件选项卡] 设置在单击之前呈黑色。
现在可以运行并且运行良好。
Last, you can choose, which of your Main Files to run by choosing it in the Build->Run menu, or by pressing shift+F2 for the first file in the list. Enter the parameters in the dialog and press OK.
Whatever I enter here, e.g. either the name of the project,
Primes_Count
or the name of what I see to be the 'executable',Primes_Count.o
, it just does not run.And I get this message output on the Messages window :
I don't see why Ada is making such a big deal out of the Run step.
If there is another stage between making the .o file and a finished Ada executable, then surely it is something that the GPS system can take care of itself . . .
December.
OK now, sorted. The GPS panel governing this [ Project menu > Edit Proj Props > Main Files tab ] setting was blacked out until clicked.
Running available now and working well.
它是项目->属性->主文件添加要运行的文件。这将解决这个问题。
it is Project->Properties-> Main Files add your file to run. This will sort out the issue.