Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 这可能是什么原因造成的;“无法解析NULL”;错误?_C - Fatal编程技术网

C 这可能是什么原因造成的;“无法解析NULL”;错误?

C 这可能是什么原因造成的;“无法解析NULL”;错误?,c,C,在Eclipse中,我有一个C程序。它在Windows中的Eclipse中可以很好地编译,但当我尝试在OSX中的Eclipse中编译它时,会出现以下几个错误 Symbol 'NULL' could not be resolved 导致它的代码如下所示: pdPASS != xTaskCreate( uartUI, (signed char*)"Uart UI", STACK_BYTES(1024*6), &System, PRIORITY_LOW, &System.task.

在Eclipse中,我有一个C程序。它在Windows中的Eclipse中可以很好地编译,但当我尝试在OSX中的Eclipse中编译它时,会出现以下几个错误

Symbol 'NULL' could not be resolved
导致它的代码如下所示:

pdPASS != xTaskCreate( uartUI, (signed char*)"Uart UI", STACK_BYTES(1024*6), &System, PRIORITY_LOW,  &System.task.userInterface )
为什么Eclipse在OSX中而不是在Windows中显示同一程序的此错误?

如上所述:

您缺少必需的#include for(或其他几个定义NULL的标题之一);参见重复的问题。可能在Windows上,您依次包含的某些标题包含定义nULL的内容。哦,根据我刚才在谷歌上搜索到的引用,xTaskCreate()的第二个参数的类型是const-portCHAR*const;你为什么要把它投给签名字符*


可能重复您缺少
所需的
#include
(或定义
空值的其他几个标题之一);参见重复的问题。可能在Windows上,您依次包含一些头文件,这些头文件定义了
nULL
。哦,根据我刚才在谷歌上搜索到的引用,
xTaskCreate()
的第二个参数的类型是
constportchar*const
;你为什么要将它转换为签名字符*
?不要责怪信使。不要为此责备IDE。这是C代码中的一个可移植性缺陷,简单明了。(已删除IDE/eclipse标记)