我已经在Linux系统(Ubuntu13.02)上安装了ecos操作系统。安装后,ecos文件位于opt/ecos中。
当我阅读ecos教程时,我看到hello.c存储在opt/ecos/ecos-3.0/examples/hello.c中(我注意到,可能所有的主要ecos系统文件都存储在ecos-3.0目录中)。
我遵循了官方网站上的ecos教程,但仍然无法成功编译hello.c。
更多细节。当我试图逃跑时:

$ export INSTALL_DIR=BASE_DIR/ecos-work/arm_install
$ TARGET-gcc -g -IBASE_DIR/ecos-work/install/include hello.c \
    -LBASE_DIR/ecos-work/install/lib -Ttarget.ld -nostdlib

我得到错误:TARGET-gcc : command not found
我试过其他一些教程,但我仍然有问题(太乱,无法在此列出)。
我正在寻找在ecos系统中编译hello.c的分步说明。我看到这方面缺少生态系统手册。
谢谢:)

最佳答案

看来你错过了生态系统中的一个微妙约定。斜体项目由您提供!它们是变量。
文档documentation这里是:

Note: Remember that when this manual shows TARGET-gcc you should use
the full name of the cross compiler, e.g. i386-elf-gcc, arm-elf-gcc,
or sh-elf-gcc. When compiling for the synthetic Linux target, use the
native gcc which must have the features required by eCos.

将target替换为适当的值,将base_dir替换为(我认为,在您的情况下)/opt/ecos。在向前移动之前,应验证include目录:
$ ls -l /opt/ecos/ecos-work/install/include

如果没有列出目录内容,那么您只需要locate ecos-work
文档的mentions部分让您创建基本目录(下面是我引用的一个片段…不会显示斜体)。
$ mkdir BASE_DIR/ecos-work
$ cd BASE_DIR/ecos-work

所以,这可能是正确的调用。
$ export INSTALL_DIR=/opt/ecos/ecos-work/arm_install
$ arm-elf-gcc -g -I/opt/ecos/ecos-work/install/include hello.c \
    -L/opt/ecos/ecos-work/install/lib -Ttarget.ld -nostdlib

关于c - eCos:在Linux上编译并运行示例应用程序,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/21918064/

10-12 04:41