From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Standalone (.exe) Ada Programs can run in isolation of any ada compiler - True or False ? Date: Thu, 05 Feb 2015 23:33:43 +0000 Organization: A noiseless patient Spider Message-ID: References: <0f33e6b4-d423-4539-ae62-680f3b72afc0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="8cd79d7ffa75567f93d907bdfb272368"; logging-data="12768"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/kFY4jraz6Zridb53amz0o9pUyt5Y5PCs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin) Cancel-Lock: sha1:WpLkYAGc+BdRCEMTkS96hYipPA4= sha1:eqlCgwr2Na/lIpRHuYor9JoqV08= Xref: news.eternal-september.org comp.lang.ada:24900 Date: 2015-02-05T23:33:43+00:00 List-Id: Austin Obyrne writes: > 1)Would some reader confirm that this true or false and explain the > mechanics of how it is done. The Ada compiler translates the source code into object code, which is linked against Ada libraries (which come with the compiler) and system libraries to produce the executable. After this point, the source code and the object code are no longer relevant. The Ada libraries and the system libraries are usually dynamic libraries (.dll on Windows), which means that they are separate entities. When you run the .exe, the system first loads the .exe and then loads all the .dlls which it needs (and the ones they need, ...); then the system can actually run the program. > 2)Is the ensuing (.exe) program then bound to that computer alone > i.e. customised for running in that environment only and will require > customising again to any other computer i.e. not generally portable > without some attention each time. You don't need to worry about the system libraries, but the Ada libraries won't be present on machines that haven't had Ada installed; and they must match the .exe, so you can't mix a GNAT GPL 2014 .exe with a GNAT GPL 2013 .dll. The simple way round this is to supply the .exe and the (Ada) .dlls it needs in one directory. On my machine, the .dlls are libgnat-2014.dll and libgnarl-2014.dll, both in C:\GNAT\2014\lib\gcc\i686-pc-mingw32\4.7.4\adalib (together with a *lot* of other files!) And, of course, this is Windows; you can't run the same .exe on Linux or Mac.