1

如下所示的应用程序

." Hello, world!"
bye

通过编译时产生以下错误gforthmi stdout.4th

/usr/bin/gforthmi: 47: /usr/bin/gforthmi: /usr/lib/gforth/0.7.3/gforth-ditc: not found
/usr/bin/gforthmi: 48: /usr/bin/gforthmi: /usr/lib/gforth/0.7.3/gforth-ditc: not found
redefined th  
*OS command line*:-1: No such file or directory
comp-image >>>./temp-image.fi1<<< ./temp-image.fi2 stdout.4th bye
Backtrace:
$7F416215C970 throw 
$7F41621924F8 slurp-file 
rm: cannot remove './temp-image.fi1': No such file or directory
rm: cannot remove './temp-image.fi2': No such file or directory

我正在gforth 0.7.3通过官方的 Ubuntu PPA 在 Ubuntu 系统上运行。

我在编译图像的方式上犯了错误吗?我错过了任何选择吗?

4

1 回答 1

1

这涉及到几个问题。

由于某种原因gforth-ditc,ubuntu 位于不同的路径中。不是下/usr/bin,而是下/use/lib/$MACHTYPE/gforth/$version。即对于 64 位 ubuntu 和 gforth 版本 0.7.2,我将它放在/usr/lib/x86_64-linux-gnu/gforth/0.7.2/gforth-ditc. 在您的系统中找到它并使用GFORTHD环境变量指定。

第二个问题是您的测试样本。它不应该以 结尾bye,因为它将终止gforth-ditc(由 使用gforthmi)而不会保存任何内容,因为 永远不会到达savesystem作为参数传递给的单词。gforth-ditc

另一个提示 - 您的测试样本将在编译期间被解释,但不会为生成的图像提供任何代码。至少定义一些要在加载图像后调用的单词:)

于 2017-07-08T09:40:24.830 回答