knolleary / pubsubclient

A client library for the Arduino Ethernet Shield that provides support for MQTT.
http://pubsubclient.knolleary.net/
MIT License
3.85k stars 1.48k forks source link

'yield' was not declared in this scope on Intel Galileo 2 #576

Open hugorjs opened 5 years ago

hugorjs commented 5 years ago

Hi friend!

I'm trying to compile the mqtt_basic example for an Intel Galileo 2 card, but it displays the following error: PubSubClient.cpp: 225: 12: error: 'yield' was not declared in this scope

you can help me?

amitjans commented 5 years ago

I have the same problem but in an intel edison, did you find the solution?

mwolfaardt commented 5 years ago

any solution?

mwolfaardt commented 5 years ago

Getting the same while running on Visual Studio Code and trying to deploy to a MX Kit Board

knolleary commented 5 years ago

What is an MX Kit Board? I can't find any reference to it on google.

mwolfaardt commented 5 years ago

Hi, https://www.mxchip.com it is the MX Chip, Microsoft Azure IOT dev board

mwolfaardt commented 5 years ago

I've got the az3166 board

knolleary commented 5 years ago

You could try adding the following to the top of your sketch:

#ifndef yield
#define yield(x) {}
#endif

or to the top of PubSubClient.h

mwolfaardt commented 5 years ago

Thanks, I've made the change, busy rebuilding.. Will also test tonight when deploying to the board

mwolfaardt commented 5 years ago

I'm getting the following :

PubSubClient.h:8:18: error: expected unqualified-id before '{' token

define yield(x) {}

              ^

C:\Users\xxx\AppData\Local\Arduino15\packages\AZ3166\hardware\stm32f4\1.6.2\system/mbed-os/rtos/Thread.h:314:21: note: in expansion of macro 'yield'

 static osStatus yield();

                 ^

exit status 1 [Error] Exit with code=1