ada

Dynamically link libgnat

只愿长相守 提交于 2019-12-22 22:17:03
问题 I'm trying to compile a very simple ADA code. Everything works like a charm but on one computer my executable is link dynamically to libgnat whereas on the other computer it's linked statically. In both cases I use gnatmake tool. Any idea why it's happening? Do you know a way to force GNAT to dynamically link libraries? 回答1: That would be the binder's -shared switch. If you are using project files, you can use: project Foo is ... package Binder is for Switches ("Ada") use ("-shared"); end

Eclipse — Manually Install Plugin

泄露秘密 提交于 2019-12-22 18:33:10
问题 I am trying to migrate from Adacore's GPS to the Eclipse based GNATBench. GNATBench is available here for free download, but is packaged as a zip file. I have only installed Eclipse plugins through the marketplace, or through an online repository. I have tried extracting the folder into the Eclipse plugins folder, but it did not work. How do I install this plugin manually through a zip file? Is there another way of getting it? 回答1: Open Help > Install New Software... and click Add (top right)

Ada GPS IDE can't seem to find GtkAda

血红的双手。 提交于 2019-12-22 11:29:57
问题 I have installed both the GNAT Programming Studio (GPS) and GtkAda. They both seem to work fine, but when I try to build the Simple Window project under New Project from Template, I get a bunch of errors saying "file gtk.ads not found." This seems to be a directory/dependency sort of problem - GPS doesn't know where to look for GtkAda. I'm running Windows 7, and have GPS installed at C:\GNAT\2011, and GtkAda installed at C:\GtkAda. I tried adding GtkAda to my PATH; at the moment my PATH user

How do I access memory addresses directly in Ada?

痞子三分冷 提交于 2019-12-22 09:39:24
问题 So I'm new to Ada, and I'm attempting to write a kernel in it, but I cannot seem to find any good information on how to do this properly. In C, I would write: unsigned char* videoram = (char*) 0xB8000; videoram[0] = 65; to access the video ram directly and write 'a' to it. I've heard I need to use an Ada array and other pragma's to do this in a typesafe manner in Ada. Is there any good resources on this kind of Ada programming? 回答1: You can use the 'Address attribute: Videoram : String (1 ..

How do I compile and link using gnatmake with an Ada shared library?

感情迁移 提交于 2019-12-22 08:15:54
问题 I am having trouble compile an applicant again the Florist library. Turns out I have a larger issue with florist (same error results from both newest 2010 Adacore GPL download and 2009 version in Debian's archive). Florist has some low-level issues but when I look through the generated files it seems to be including errno.h correctly. Here is what happens when I build florist: gcc-4.4 -c -I/usr/share/ada/adainclude/florist demo.adb gcc-4.4 -c -I./ -I/usr/share/ada/adainclude/florist -I- /usr

Can you call Ada functions from C++?

邮差的信 提交于 2019-12-21 14:37:24
问题 I'm a complete Ada newbie, though I've used Pascal for 2-3 years during HS. IIRC, it is possible to call Pascal compiled functions from C/C++. Is it possible to call procedures & functions written in Ada from C++? 回答1: According to this old tutorial, it should be possible. However, as illustrated by this thread, you must be careful with the c++ extern "C" definitions of your Ada functions. 回答2: Here's an example using g++/gnatmake 5.3.0: NOTE: Be careful when passing data between C++ and Ada

Ada subtype equivalent in C++

谁说我不能喝 提交于 2019-12-21 03:42:41
问题 Does C++ offer something similar to Ada's subtype to narrow a type? E.g.: type Weekday is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); subtype Working_Day is Weekday range Monday .. Friday; 回答1: No, not natively. What you describe might be best represented as a scoped enum, accompanied by a separate scoped enum with a subset of enumerations who share numerical representations with the "parent" scoped enum. You could further define some conversions between the two, but

Ada 83(Only) How to end an entire program which has multiple procedures

ⅰ亾dé卋堺 提交于 2019-12-20 04:20:49
问题 I am using Ada83 (It's a course requirement to use this version), I am using multiple procedures. I don't know how to come out of the entire program. Some thing like Exit in C program which closes entire procedure. Where is the exit is called from? 回答1: If your program does not use tasks, you can define an exception that signifies an "emergency exit"; perhaps in some package: package Emergency is Emergency_Exit : exception; end Emergency; In your main procedure, catch this exception:

What is the Ada command line redirector that is analogous to “>”?

╄→尐↘猪︶ㄣ 提交于 2019-12-20 04:14:02
问题 Ada noob here (and also not so hot with the command line in general). I am looking for the Ada command line redirector that would be analogous to ">" in DOS. I am running an Ada application in a command line shell. (William Whitaker's WORDS, if that is helpful). I use the "@" command to get the WORDS application to read the list of terms from a text file. I want the output to be written to a file, not to just appear in the command shell. I did look at http://www.ada-auth.org/standards/12rm

Ada: plotting 2d graphs

别等时光非礼了梦想. 提交于 2019-12-20 03:44:30
问题 it would be interesting to be able to plot a 2D graph within an Ada code rather than having to save values say to file and use an external drawing software afterwards. A search on the web has taken me to two packages: Win_IO and JEWL. I have been able to use WIN_IO though but the documentation is quite poor and having just started using it, it seems that it is not possible to resize the size of the canvas. I use the GPS editor and I get complaint when running Win_IO that some fonts are not