Компиляция функций Arduino под IAR - PullRequest
0 голосов
/ 05 января 2020

Извините, что задаю такие простые вопросы, но я изо всех сил пытаюсь преодолеть это. Я пытаюсь скомпилировать подмножество библиотеки Arduino (print. cpp) под IAR, но не могу заставить его работать. Под G CC и MSV C он работает, но при попытке сделать это с помощью IAR ARM я получаю ошибку "Error[Pe338]: more than one instance of overloaded function "operator+" has "C" linkage" в следующем коде в WString.h

friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs);
friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr);
friend StringSumHelper & operator + (const StringSumHelper &lhs, char c);
friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num);
friend StringSumHelper & operator + (const StringSumHelper &lhs, int num);
friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num);
friend StringSumHelper & operator + (const StringSumHelper &lhs, long num);
friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num);
friend StringSumHelper & operator + (const StringSumHelper &lhs, float num);
friend StringSumHelper & operator + (const StringSumHelper &lhs, double num);
friend StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs);

При использовании автомати c Режим IAR в режиме C / C ++ по умолчанию равен "C", поэтому я принудительно включил его в режиме C ++.

...