comp.lang.ada
 help / color / mirror / Atom feed
* Working folders for a project
@ 2022-09-27  2:50 Rick Duley
  2022-09-27  3:24 ` Nasser M. Abbasi
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Rick Duley @ 2022-09-27  2:50 UTC (permalink / raw)


It is my practice to load my software in the folder 'C:\' on my PC but to do my work in a separate disc partition 'D:\'.

I have created a new Project deploying it in D:\Ada Programming.  I specified the Project Name and Main Name as My_SDC.  My_SDC reads

project My_Sdc is
    for Source_Dirs use ("Source Files");
    for Object_Dir use "Object Files";
    for Main use ("my_sdc.adb");
end My_Sdc;

Project --> Build All is successful and placed the relevant files where I expect them to be.

Project --> Build and Run --> My_SDC.adb results in this error message:

[2022-09-27 10:45:00] Error while trying to execute D:\Ada Programming\obj\my_sdc.exe: not an executable

Something is looking for a folder called D:\Ada Programming\obj which does not exist.  How do I get it to look in the right place?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-27  2:50 Working folders for a project Rick Duley
@ 2022-09-27  3:24 ` Nasser M. Abbasi
  2022-09-27  6:14 ` Emmanuel Briot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Nasser M. Abbasi @ 2022-09-27  3:24 UTC (permalink / raw)


On 9/26/2022 9:50 PM, Rick Duley wrote:
> It is my practice to load my software in the folder 'C:\' on my PC but to do my work in a separate disc partition 'D:\'.
> 
> I have created a new Project deploying it in D:\Ada Programming.  I specified the Project Name and Main Name as My_SDC.  My_SDC reads
> 
> project My_Sdc is
>      for Source_Dirs use ("Source Files");
>      for Object_Dir use "Object Files";
>      for Main use ("my_sdc.adb");
> end My_Sdc;
> 
> Project --> Build All is successful and placed the relevant files where I expect them to be.
> 
> Project --> Build and Run --> My_SDC.adb results in this error message:
> 
> [2022-09-27 10:45:00] Error while trying to execute D:\Ada Programming\obj\my_sdc.exe: not an executable
> 
> Something is looking for a folder called D:\Ada Programming\obj which does not exist.  How do I get it to look in the right place?
> 

I can't help you with the error but just one free advice

Never, ever use a space in files names or folder names.

Use "_" instead of space as a separator.

So "Ada Programming" folder name should be renamed to "Ada_Programming"

--Nasser

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-27  2:50 Working folders for a project Rick Duley
  2022-09-27  3:24 ` Nasser M. Abbasi
@ 2022-09-27  6:14 ` Emmanuel Briot
  2022-09-27  6:27 ` Dmitry A. Kazakov
  2022-09-28 20:35 ` Stephen Leake
  3 siblings, 0 replies; 12+ messages in thread
From: Emmanuel Briot @ 2022-09-27  6:14 UTC (permalink / raw)


> project My_Sdc is 
> for Source_Dirs use ("Source Files"); 
> for Object_Dir use "Object Files"; 
> for Main use ("my_sdc.adb"); 
> end My_Sdc; 

> Project --> Build and Run --> My_SDC.adb results in this error message: 

Hello,
It has been years since I last used and develop GNAT Visual Studio, so I can't really help you. But a hint might be the
casing discrepency between the project file (my_sdbc.adb all lower cases) and the menu (My_SDC.adb). Maybe you
are not, in effect, loading that project file, but another one ? If I remember right, Studio will load a default project if
you do not load one explicitly, and it might well be using "obj" as the object directory, which is a frequent convention.

Emmanuel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-27  2:50 Working folders for a project Rick Duley
  2022-09-27  3:24 ` Nasser M. Abbasi
  2022-09-27  6:14 ` Emmanuel Briot
@ 2022-09-27  6:27 ` Dmitry A. Kazakov
  2022-09-27  7:43   ` Rick Duley
                     ` (2 more replies)
  2022-09-28 20:35 ` Stephen Leake
  3 siblings, 3 replies; 12+ messages in thread
From: Dmitry A. Kazakov @ 2022-09-27  6:27 UTC (permalink / raw)


On 2022-09-27 04:50, Rick Duley wrote:
> It is my practice to load my software in the folder 'C:\' on my PC but to do my work in a separate disc partition 'D:\'.
> 
> I have created a new Project deploying it in D:\Ada Programming.  I specified the Project Name and Main Name as My_SDC.  My_SDC reads
> 
> project My_Sdc is
>      for Source_Dirs use ("Source Files");
>      for Object_Dir use "Object Files";
>      for Main use ("my_sdc.adb");
> end My_Sdc;
> 
> Project --> Build All is successful and placed the relevant files where I expect them to be.
> 
> Project --> Build and Run --> My_SDC.adb results in this error message:
> 
> [2022-09-27 10:45:00] Error while trying to execute D:\Ada Programming\obj\my_sdc.exe: not an executable
> 
> Something is looking for a folder called D:\Ada Programming\obj which does not exist.  How do I get it to look in the right place?

The binary directories are

    for Exec_Dir use ...;

and (for a library):

    for Library_Dir use ...;

There is no need to specify any (Object_Dir included) unless you build 
for different targets/scenarios, e.g. Debug/Release/Profile and need to 
sort them out.

E.g.

    for Object_Dir use
       "obj" & Target_OS & "/" & Target_Arch & "/" & Development_Type;

As other said, keep you project interoperable between Windows and Linux:

1. Always use small letters
2. Newer use spaces
3. Newer use \ as a directory separator. (GCC and GNAT run-times 
understand /).
4. Newer use Latin-1 or UTF-8 (not even in the string literals).

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-27  6:27 ` Dmitry A. Kazakov
@ 2022-09-27  7:43   ` Rick Duley
  2022-09-27  8:30     ` Dmitry A. Kazakov
  2022-09-27  7:59   ` G.B.
  2022-09-27 14:16   ` Simon Wright
  2 siblings, 1 reply; 12+ messages in thread
From: Rick Duley @ 2022-09-27  7:43 UTC (permalink / raw)


On Tuesday, September 27, 2022 at 2:27:36 PM UTC+8, Dmitry A. Kazakov wrote:

> 4. Newer use Latin-1 or UTF-8 (not even in the string literals). 
> 


I have no idea what text Studio is using,

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-27  6:27 ` Dmitry A. Kazakov
  2022-09-27  7:43   ` Rick Duley
@ 2022-09-27  7:59   ` G.B.
  2022-09-27 14:16   ` Simon Wright
  2 siblings, 0 replies; 12+ messages in thread
From: G.B. @ 2022-09-27  7:59 UTC (permalink / raw)


On 27.09.22 08:27, Dmitry A. Kazakov wrote:
said, keep you project interoperable between Windows and Linux:
> 
> 1. Always use small letters
> 2. Newer use spaces
> 3. Newer use \ as a directory separator. (GCC and GNAT run-times understand /).
> 4. Newer use Latin-1 or UTF-8 (not even in the string literals).

0. Never, ever, use full path literals. Or separator characters.
0.5. Fix GCC's silly dependence on path literals.





^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-27  7:43   ` Rick Duley
@ 2022-09-27  8:30     ` Dmitry A. Kazakov
  0 siblings, 0 replies; 12+ messages in thread
From: Dmitry A. Kazakov @ 2022-09-27  8:30 UTC (permalink / raw)


On 2022-09-27 09:43, Rick Duley wrote:
> On Tuesday, September 27, 2022 at 2:27:36 PM UTC+8, Dmitry A. Kazakov wrote:
> 
>> 4. Newer use Latin-1 or UTF-8 (not even in the string literals).
> 
> I have no idea what text Studio is using,

You have idea what letter you type. Do not type umlauts and you are good.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-27  6:27 ` Dmitry A. Kazakov
  2022-09-27  7:43   ` Rick Duley
  2022-09-27  7:59   ` G.B.
@ 2022-09-27 14:16   ` Simon Wright
  2 siblings, 0 replies; 12+ messages in thread
From: Simon Wright @ 2022-09-27 14:16 UTC (permalink / raw)


"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:

> There is no need to specify any (Object_Dir included) unless you build
> for different targets/scenarios, e.g. Debug/Release/Profile and need
> to sort them out.

This is true, but I like to keep all the compiler-created stuff out of
sight.

Only one problem with that: that's where the executables get created! so
I'd say

   for Object_Dir use ("obj");
   for Exec_Dir use (".");  -- the same directory as the project file

NB Alire likes to use

   for Exec_Dir use ("bin");

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-27  2:50 Working folders for a project Rick Duley
                   ` (2 preceding siblings ...)
  2022-09-27  6:27 ` Dmitry A. Kazakov
@ 2022-09-28 20:35 ` Stephen Leake
  2022-09-28 21:22   ` Björn Lundin
  2022-09-29  8:13   ` Simon Wright
  3 siblings, 2 replies; 12+ messages in thread
From: Stephen Leake @ 2022-09-28 20:35 UTC (permalink / raw)


Rick Duley <rickduley@gmail.com> writes:

> It is my practice to load my software in the folder 'C:\' on my PC but
> to do my work in a separate disc partition 'D:\'.
>
> I have created a new Project deploying it in D:\Ada Programming. I
> specified the Project Name and Main Name as My_SDC. My_SDC reads
>
> project My_Sdc is
>     for Source_Dirs use ("Source Files");
>     for Object_Dir use "Object Files";

Note that this is different from the default "obj" for Object_Dir.

How did you edit this gpr file? if you did not use the GNAT Studio
Preferences editor, GNAT Studio does not know about this change from the
default. 

> 
>     for Main use ("my_sdc.adb"); end My_Sdc;
>
> Project --> Build All is successful and placed the relevant files
> where I expect them to be.

I'm assuming you meaning the .exe is "D:\Ada Programming\Object
Files\my_sdc.exe", since that's what the gpr file says.

> Project --> Build and Run --> My_SDC.adb results in this error message:
>
> [2022-09-27 10:45:00] Error while trying to execute D:\Ada
> Programming\obj\my_sdc.exe: not an executable

This indicates GNAT Studio is not using the gpr file you want it to.

You can discover what GNAT Studio thinks the project file is by hovering
the mouse over the root folder in the Project window; for the Hello
World project I created, this shows
"/Projects/hello_world/hello_world.gpr" (I'm on Debian, hence the Unix
directory separators).

> Something is looking for a folder called D:\Ada Programming\obj which
> does not exist. How do I get it to look in the right place?

You need to specify your gpr file as the project file to open.

If you've edited the project file after you opened the project, you need
to tell GNAT Studio to read it again. I don't know how to do that short
of close the project and open it again.

-- 
-- Stephe

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-28 20:35 ` Stephen Leake
@ 2022-09-28 21:22   ` Björn Lundin
  2022-09-29  8:13   ` Simon Wright
  1 sibling, 0 replies; 12+ messages in thread
From: Björn Lundin @ 2022-09-28 21:22 UTC (permalink / raw)


On 2022-09-28 22:35, Stephen Leake wrote:

> If you've edited the project file after you opened the project, you need
> to tell GNAT Studio to read it again. I don't know how to do that short
> of close the project and open it again.
> 

In the tabs to the left, the project tab has the reload symbol in top 
left corner.
Two arrows forming a circle

-- 
/Björn

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-28 20:35 ` Stephen Leake
  2022-09-28 21:22   ` Björn Lundin
@ 2022-09-29  8:13   ` Simon Wright
  2022-09-29  8:57     ` Simon Wright
  1 sibling, 1 reply; 12+ messages in thread
From: Simon Wright @ 2022-09-29  8:13 UTC (permalink / raw)


Stephen Leake <stephen_leake@stephe-leake.org> writes:

> How did you edit this gpr file? if you did not use the GNAT Studio
> Preferences editor, GNAT Studio does not know about this change from
> the default.

Studio has no memory between sessions aside from what's in the gpr file

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Working folders for a project
  2022-09-29  8:13   ` Simon Wright
@ 2022-09-29  8:57     ` Simon Wright
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Wright @ 2022-09-29  8:57 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> Studio has no memory between sessions aside from what's in the gpr
> file

I was very definite about that, but it's not quite true: GPS2019 (the
latest available edition for Mac) remembers scenario variables.

Also, ofc, preferences, previously-opened GPR files, ... I was only
thinking about project files.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-09-29  8:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27  2:50 Working folders for a project Rick Duley
2022-09-27  3:24 ` Nasser M. Abbasi
2022-09-27  6:14 ` Emmanuel Briot
2022-09-27  6:27 ` Dmitry A. Kazakov
2022-09-27  7:43   ` Rick Duley
2022-09-27  8:30     ` Dmitry A. Kazakov
2022-09-27  7:59   ` G.B.
2022-09-27 14:16   ` Simon Wright
2022-09-28 20:35 ` Stephen Leake
2022-09-28 21:22   ` Björn Lundin
2022-09-29  8:13   ` Simon Wright
2022-09-29  8:57     ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox