Chinaunix首页 | 论坛 | 博客
  • 博客访问: 363849
  • 博文数量: 53
  • 博客积分: 2000
  • 博客等级: 大尉
  • 技术积分: 1143
  • 用 户 组: 普通用户
  • 注册时间: 2007-11-14 11:53
文章分类

全部博文(53)

文章存档

2011年(1)

2008年(52)

我的朋友

分类:

2008-09-19 21:33:03

vxworks默认的注释类型是“/*。。。。。*/”在使用C++类型的注释“//”,就有可能报错。 一种方法是移除-ansi开关。可是怎么移除呢?对许多对编译器不太了解的人可能看了FAQ了不知道怎么办。下面具体讲解:

在vxworks的工程里有build这个选项,字体变黑的就是你选的编译类型以default为例,双击default(默认的),在c/c++compiler和assember里将-ansi去掉,然后再OK!
下面来自预编译器文档`-lang-c', `-lang-c89', `-lang-c++'
`-lang-objc', `-lang-objc++'
Specify the source language. `-lang-c' is the default; it allows recognition of C++
comments (comments that begin with `//' and end at end of line), since this is a common
feature and it will most likely be in the next C standard. `-lang-c89' disables recognition
of C++ comments. `-lang-c++' handles C++ comment syntax and includes extra default include
directories for C++. `-lang-objc' enables the Objective C `#import' directive. `-lang-objc++'
enables both C++ and Objective C extensions. These options are generated by the compiler
driver gcc, but not passed from the `gcc' command line unless you use the driver's `-Wp'
option .

其实如果要跟深入了解,可以看看GNU方面的资料

另外,在.cpp格式的文件中可以使用//做注释,编译不会报错。
阅读(1355) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~