• Working folders for a project

    From Rick Duley@21:1/5 to All on Mon Sep 26 19:50:41 2022
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nasser M. Abbasi@21:1/5 to Rick Duley on Mon Sep 26 22:24:44 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Emmanuel Briot@21:1/5 to All on Mon Sep 26 23:14:08 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Rick Duley on Tue Sep 27 08:27:30 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rick Duley@21:1/5 to Dmitry A. Kazakov on Tue Sep 27 00:43:31 2022
    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,

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From G.B.@21:1/5 to Dmitry A. Kazakov on Tue Sep 27 09:59:29 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dmitry A. Kazakov@21:1/5 to Rick Duley on Tue Sep 27 10:30:22 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Dmitry A. Kazakov on Tue Sep 27 15:16:34 2022
    "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");

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stephen Leake@21:1/5 to Rick Duley on Wed Sep 28 13:35:08 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Bj=c3=b6rn_Lundin?=@21:1/5 to Stephen Leake on Wed Sep 28 23:22:57 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Stephen Leake on Thu Sep 29 09:13:09 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Simon Wright@21:1/5 to Simon Wright on Thu Sep 29 09:57:30 2022
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)