我在linux系统上安装了eCos OS(Ubuntu 13.02)。安装后,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
的分步说明。我看到这个领域缺乏eCos手册。
谢谢:)
答案 0 :(得分:2)
您似乎错过了eCos documentation中的一个微妙的约定。 斜体中的项目由您提供!它们是变量。
此处的文档mentions:
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
文档的Ecosconfig on Windows and Linux Quick Start部分可以创建 BASE_DIR 目录(下面是我引用的代码段...不会显示斜体)。
$ 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
答案 1 :(得分:0)
你需要做
# source /opt/ecos/ecosenv.sh
然后你可以尝试通过改变TARGET =
进行编译$ TARGET-gcc -g -IBASE_DIR / ecos-work / install / include hello.c \ -LBASE_DIR / ecos-work / install / lib -Ttarget.ld -nostdlib