As the title states, I'm trying to use the chipkit core in MPLAB X IDE. I'm doing this because I want to be able to properly debug the PIC32 board that I'm using for this project, but I don't have the time to re-write all of the Arduino/Arduino-alike libraries that the project already uses.
However, when trying to compile, I'm running into issues in the chipkit code (not even my code!). The current error that is stumping me is:
In file included from ../../chipKit_pic32/2.1.0/cores/pic32/noniso.c:25:0:
../../chipKit_pic32/2.1.0/cores/pic32/stdlib_noniso.h:34:5: error: expected identifier or '(' before 'int'
int atoi(const char *s);
^
../../chipKit_pic32/2.1.0/cores/pic32/stdlib_noniso.h:36:6: error: expected identifier or '(' before 'long'
long atol(const char* s);
^
../../chipKit_pic32/2.1.0/cores/pic32/stdlib_noniso.h:38:8: error: expected declaration specifiers or '...' before numeric constant
double atof(const char* s);
^
../../chipKit_pic32/2.1.0/cores/pic32/stdlib_noniso.h:38:8: error: expected declaration specifiers or '...' before numeric constant
double atof(const char* s);
^
I can only assume that I'm missing something dumb, but for the life of me I can't find it.
The file "stdlib_noniso.h" is as follows:
#ifndef STDLIB_NONISO_H
#define STDLIB_NONISO_H
//#define _NEED_REVERSE
//#define _NEED_LTOA
//#define _NEED_ULTOA
#define _NEED_DTOSTRF
#ifdef __cplusplus
extern "C"{
#endif
int atoi(const char *s);
long atol(const char* s);
double atof(const char* s);
char* itoa (int val, char *s, int radix);
#ifdef _NEED_LTOA
char* ltoa (long val, char *s, int radix);
#endif
char* utoa (unsigned int val, char *s, int radix);
#ifdef _NEED_ULTOA
char* ultoa (unsigned long val, char *s, int radix);
#endif
#ifdef _NEED_DTOSTRF
char* dtostrf (double val, signed char width, unsigned char prec, char *s);
#endif
#ifdef _NEED_REVERSE
void reverse(char* begin, char* end);
#endif
#ifdef __cplusplus
} // extern "C"
#endif
#endif
I don't want to be a bad question-asker, but I don't know what other information I should add. I've gone looking for macros that might be causing issues, and I've looked at the files that #include stdlib_noniso.h, but I haven't been able to find anything there either. For the record, those files that include it are WProgram.h, WString.h, and noniso.c, all of which are also part of chipkit core.
#include <Arduino.h>