如何在Contiki OS中运行hello world?

如何在Contiki OS中运行hello world?,c,contiki,C,Contiki,我是contiki os的新手,我尝试编译并运行位于contiki os 3.0中examples目录下的hello world.c文件。但我错了 hello world.c:40:21:致命错误:contiki.h:没有这样的文件或目录 我在root用户中尝试了这个 对于在contiki中运行初学者程序的任何帮助,我们都表示感谢 使用make命令构建Contiki。这样做将调用特定于体系结构的gcc版本,编译器标志指向正确的头文件路径: 默认情况下,make将为本机平台(即x86)构建,并创

我是contiki os的新手,我尝试编译并运行位于contiki os 3.0中examples目录下的hello world.c文件。但我错了

hello world.c:40:21:致命错误:contiki.h:没有这样的文件或目录

我在root用户中尝试了这个

对于在contiki中运行初学者程序的任何帮助,我们都表示感谢

使用make命令构建Contiki。这样做将调用特定于体系结构的gcc版本,编译器标志指向正确的头文件路径:

默认情况下,make将为本机平台(即x86)构建,并创建可在主机PC上执行的应用程序映像

要为特定硬件平台构建,请设置目标变量。例如,要为Tmote Sky/TelosB节点构建:

make TARGET=sky hello-world
要为本机平台构建和运行,请执行以下操作:

make
输出:

TARGET not defined, using target 'native'
mkdir obj_native
...
CC        hello-world.c
LD        hello-world.native
rm hello-world.co
 Contiki-3.x-1457-g552408b started with IPV6, RPL
 Rime started with address 1.2.3.4.5.6.7.8
 MAC nullmac RDC nullrdc NETWORK sicslowpan
 Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708
 Hello, world
要运行它,请执行以下操作:

./hello-world.native 
输出:

TARGET not defined, using target 'native'
mkdir obj_native
...
CC        hello-world.c
LD        hello-world.native
rm hello-world.co
 Contiki-3.x-1457-g552408b started with IPV6, RPL
 Rime started with address 1.2.3.4.5.6.7.8
 MAC nullmac RDC nullrdc NETWORK sicslowpan
 Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708
 Hello, world

感谢所有帮助回答我问题的人。最后,我能够在Contiki OS运行第一个hello world程序。我已经使用了以下代码语法

$cd contiki
$cd examples/hello-world
$make TARGET=native
要运行编译后的代码,请使用以下代码

$ ./hello-world.native
输出:

Contiki 3.0 started with IPV6, RPL
Rime started with address 1.2.3.4.5.6.7.8
MAC nullmac RDC nullrdc NETWORK sicslowpan
Tentative link-local IPv6 address fe80:0000:0000:0000:0302:0304:0506:0708
Hello, world

最好只是将文本从终端复制到帖子上,而不是拍照。谢谢你发布图片。要知道准确的误差,图像效果要好得多。所以我试着贴图片。从下一次开始,我将发布终端的错误。我对contiki非常陌生。所以我无法运行hello world。你能给我提供一些关于hello world运行方式的更多细节吗。谢谢你的帮助。非常感谢。