0

In Eclipse I have this C program. It compiles fine in Eclipse in Windows, but when I try to compile it in Eclipse in OSX, I get several of these errors.

Symbol 'NULL' could not be resolved

The code that causes it is this:

pdPASS != xTaskCreate( uartUI, (signed char*)"Uart UI", STACK_BYTES(1024*6), &System, PRIORITY_LOW,  &System.task.userInterface )

Why is Eclipse showing this error for the same program in OSX but not in Windows?

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
node ninja
  • 31,796
  • 59
  • 166
  • 254
  • Possibly duplicated http://stackoverflow.com/questions/7433448/eclipse-cdt-symbol-null-could-not-be-resolved – coelhudo Nov 14 '11 at 17:40
  • 4
    You're missing a required `#include` for `` (or one of several other headers that defines `NULL`); see the duplicated question. Probably on Windows some header you `#include` in turn `#include`s something that defines `nULL`. Oh, and according to the reference I just Googled, the second argument to `xTaskCreate()` is of type `const portCHAR * const`; why are you casting it to `signed char*`? – Keith Thompson Nov 14 '11 at 19:22
  • Don't blame the messenger. Don't blame the IDE for this. This is a portability bug in your C code, plain and simple. (Removed IDE / eclipse tags) – Stephen C Nov 09 '19 at 04:28

1 Answers1

2

As noted above:

You're missing a required #include for (or one of several other headers that defines NULL); see the duplicated question. Probably on Windows some header you #include in turn #includes something that defines nULL. Oh, and according to the reference I just Googled, the second argument to xTaskCreate() is of type const portCHAR * const; why are you casting it to signed char*

Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265