compiler-construction - 在没有 Gforth 的情况下编译 Gforth?

标签 compiler-construction macos forth

当我尝试编译 Gforth 0.7.0 时,出现以下错误:

$ ./configure
$ make
#compiling… 
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[3]: *** [gforth-ll] Error 1
./preforth -p ".:~+:." -e 's" mach16b.fs"' ./kernel/main.fs -e "save-cross kernl16b.fi- /usr/local/bin/gforth-0.7.0 bye"
You need to configure with a gforth in $PATH to build this part
make[3]: *** [kernl16b.fi-] Error 1
make[2]: *** [gforth-ll] Error 2
make[1]: *** [optgforth] Error 2
make: *** [gforth] Error 2
[22:16:01] gforth-0.7.0$ 

通过端口安装时出现同样的错误。我想问题是 Gforth 是用 Forth 编写的,至少部分是用 Forth 编写的,那么我如何在不先安装的情况下安装它(或者是其他问题)?

我使用的是 Mac OS 10.6。

最佳答案

在配置期间,我收到消息:

...
checking how to invoke m4... m4 -s
checking for gforth... echo "You need to configure with a gforth in \$PATH to build this part" && false
checking for ./arch/386/asm.fs... yes
...

我还发现,当我使用普通 GCC(在 64 位模式下)构建时,在编译过程中出现了可怕的错误(我认为是在汇编程序插入中提示错误指定的寄存器)。但是当我重新配置时:
CC="gcc -m32" ./configure --prefix=$HOME

我仍然收到关于 'gforth' 的警告,但编译的其余部分成功了。安装出现了关于“chcon”不起作用的警告,但错误被忽略。

安装后,我可以输入:
Osiris-2 JL: gforth
Gforth 0.7.0, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'
Type `bye' to exit
2 3 +  ok
. 5  ok

Osiris-2 JL: uname -a
Darwin Osiris-2.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov  3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386
Osiris-2 JL:

关于compiler-construction - 在没有 Gforth 的情况下编译 Gforth?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2384366/

相关文章:

integer-arithmetic - Forth 中两个 double 整数相除

opengl - 如何使用 OpenGL 在 Forth 中画一条线?

c++ - 常量字段中的初始化列表不生成 operator=

macos - 我正在尝试使用 Visual Studio Code 运行 fortran 代码。不知道如何运行代码

macos - 绘制具有渐变颜色的字符串

javascript - 发出 GET 请求时出错 "Failed to load resource: net::ERR_CONNECTION_REFUSED"

javascript - 什么是随机逻辑词法扫描器,什么是树遍历代码生成器?

c++ - 原子操作、std::atomic<> 和写入顺序

.net - 无论版本如何,如何引用 DLL?

compiler-construction - 实现 8051 的函数调用