From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!aioe.org!gy7opw3oYmwPg+L8gXeD2w.user.46.165.242.75.POSTED!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: A new universe of Ada Date: Wed, 28 Sep 2022 11:28:05 -0700 Organization: Aioe.org NNTP Server Message-ID: <86r0zvicay.fsf@stephe-leake.org> References: <41ea7a4d-5c01-458d-98c3-1d671805b88fn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: gioia.aioe.org; logging-data="33868"; posting-host="gy7opw3oYmwPg+L8gXeD2w.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (windows-nt) Cancel-Lock: sha1:adkSC9m581NXmF9PvGJlkTmAgW0= X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:64451 List-Id: "Dmitry A. Kazakov" writes: > On 2022-09-26 09:11, Rick Duley wrote: >> You missed the point, Dmitry. Showing me the code for Hello_World >> does not show me how to create the program using Gnat Studio. > > Hmm, programs are created by typing them in an editor... Gnat Studio is an IDE, not just an Editor. >> Firstly, I do not understand the concept of a _Project_. > > Project is an executable or shared/static library. It is much more than that. In technical terms, for GNAT Studio a "Project" is defined by a gnat project file. In turn, that project file defines the list of source directories, where to store object and executable files, the compilation options for release and debug builds, and a few other things. GNAT Studio can create and edit project files for you. When you get to more complex projects, you will want to edit them directly. There are tutorials on using gnat studio, including debugging, at https://www.adacore.com/gnatpro/toolsuite/gnatstudio (I found them by searching for "GNAT Studio"). >> Until a couple of days ago I had never heard the term in reference to Ada Programming. > > It always existed. E.g. Ada 83 Reference Manual called it "the program > library". See ARM 83 (10.4) Which is literally not "project", although it is a similar concept. "Project" is now a common term in many software tools. >> Secondly, I can write Hello_World.adb and have it included in my >> 'Project', I can even build it, but the only thing that will run is >> _Main_. > > No, I provided the project file where the main procedure is called > Hello_World. > >> I cannot find any documentation about Studio which explains >> something as simple as the creation of Hello_World.exe. Can you do >> that in Studio or is it purely ornamental? Here are the steps I used to create "hello world" in Gnat Studio: - Start gnat studio from the command line. - If you have no previous projects, it starts a wizard that offers to create new project from a template. You get the same wizard by selecting File | New Project from the main GNAT Studio interface. In the wizard, choose Basic | Simple Ada Project. - Select a directory to hold the project files (GNAT Studio calls it "deploy"); I created a new directory named "hello_world". - change the project name from "default" to "Hello_World" (it must be a valid Ada identifier). - Change the Main Name from "main" to "hello_world". (this is the crucial step you have been asking for). - Now you are in the main GNAT Studio interface. Note that it has created the "src" and "obj" directories, and src/hello_world.adb for you. Every IDE (except Emacs :) has a default notion of the "proper" layout for directories; some let you change that default (I don't know if GNAT Studio does). Some build systems tolerate other directory structures; GNAT Studio does as long as the corresponding changes are made in the project file. - Edit hello_world.adb to do Put_Line ("Hello_World"); - From the menu, select Build | Run | "Run main" The project is compiled, and the program is run. However, I don't see the output from the program in the Messages window. And running the exectable (which is hello_word/obj/hello_world) does not produce any output. Ah; I just saw Dmitry's hint about Debug | Initialize. Doing that starts the gdb interface in GNAT Stdio. Clicking the "Run" button (which looks like a media player "play" button) runs the program, which prints Hello World in the debugger console. Success! I'm guessing running the executable from the command line failed because some library was not found; GNAT Studio must set up the library search paths. Apparently it was compiled without debug options. But in Edit | Project Properties, I don't see anything about Debug. And there's no way to search for a property; does anyone know where that is? -- -- Stephe