【问题标题】:NCurses build environment for Ada 2012 under Ubuntu 19.10Ubuntu 19.10 下 Ada 2012 的 NCurses 构建环境
【发布时间】:2019-12-23 22:57:08
【问题描述】:

我有一个即将推出的 Ada 项目(命令行交互式控制台程序),我想使用类似 ncurses 的东西来简化屏幕管理。

我已经安装了以下软件包(在带有最新更新的 Ubuntu 19.10 下):

  • GNAT 8.3.0
  • libncurses-dev
  • libncursesada-dev
  • libncursesada6.2.20180127
  • libncursesada6.2.20180127-dev

在“....../libncursesada-doc/examples/”目录中有不少演示程序,尝试构建其中任何一个都会引起以下投诉:

$ gnatmake rain
aarch64-linux-gnu-gcc-8 -c rain.adb
rain.adb:44:06: file "terminal_interface.ads" not found
rain.adb:44:06: "Rain (body)" depends on "Ncurses2.Util (spec)"
rain.adb:44:06: "Ncurses2.Util (spec)" depends on "Terminal_Interface (spec)"
rain.adb:47:06: file "terminal_interface.ads" not found
gnatmake: "rain.adb" compilation error

这个丢失的文件是否表明这组软件包已损坏,或者我只是在某个地方漏掉了一个?

或者换一种说法,我是不是用 ncurses 找错树了?有没有与 Ada 配合得很好的现代替代方案?

【问题讨论】:

    标签: terminal ada ncurses interactive


    【解决方案1】:

    这在 Debian 10 上对我有用。

    GNAT 版本:

    $ gnat --version
    GNAT 8.3.0
    Copyright (C) 1996-2018, Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.
    There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    

    安装:

    $ sudo apt-get install \
      libncurses-dev \
      libncursesada-doc \
      libncursesada6.2.20180127 \
      libncursesada6.2.20180127-dev
    

    创建一个新目录:

    $ cd ~
    $ mkdir rain
    $ cd ~/rain
    

    现在构建。在这种情况下,我们需要使用-aI(另见here)提供对源目录的引用,并使用-largs -lncursesada(另见here)链接libncursesada

    $ gnatmake \
      -aI/usr/share/doc/libncursesada-doc/examples \
      -aI/usr/share/ada/adainclude/ncursesada \
      rain.adb \
      -largs -lncursesada
    

    【讨论】:

    • 太棒了,rain 程序运行良好。这似乎也适用于“ncurses.adb”演示,这似乎是 ncurses Ada 绑定的非常全面的演示。我希望其他人觉得这很有用。感谢您的帮助@DeeDee
    猜你喜欢
    • 2020-03-05
    • 2020-04-07
    • 1970-01-01
    • 1970-01-01
    • 2011-09-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-04
    相关资源
    最近更新 更多