Write a "hello,world!" program in VxWorks v5.5, use Tornado v2.2.

来源:互联网 发布:淘宝店铺推荐 知乎 编辑:程序博客网 时间:2024/06/07 20:13

1. Download Tornado V2.2 from web site(http://www.verycd.com/topics/80328/), then install it.

2. Create a project and add a main.c file;
/******************************************************************
* Main.c:
* Author: Wenxy,wen_kernel@163.com, 20080306
* Fix history:
*
*******************************************************************/

#include <vxworks.h>
#include <stdlib.h>
#include <stdio.h>


int Add(int a, int b)
{
 return a+b;
}

int main(int argc, char **argv)
{
 int a,b,num;
 printf("hello world!/n");
 a= 1;
 b= 2;
 printf("%d+%d=%d/n", a,b,Add(a,b));

 return 0;
}

3. Compile main.c and Built *.out(Name may be project0.out) file;
4. Start simulate;
5. Download *.out file;
6. Start Shell, then input 'main' and enter. What do you see? :-), that's all.
  

原创粉丝点击