Temboo library error Unknown type name 'bool'

Status
Not open for further replies.

teensycoder

New member
I'm using a teensy 3.6 to try and do some searching of twitter using the Temboo website and library.

Unfortunately I've fallen at the first fence.
The library is designed for the Arduino Yun but anyway always was up for a challenge.

When I include the library and compile I get the error unknown type name 'bool' from one of the files (TembooWebSocketRequestHandles.h). Looks like a fundamental problem somewhere and I'm not sure how the Arduino gets 'bool' defined but obviously it's not picking it up here. Has anyone had the same problem or can suggest what to change/include?

Fairly simple code:

#include <Temboo.h>
void setup()
{

}

void loop()
{

}
 
The bool problem is above my pay grade, hopefully one of the language experts will chime in. Here's what I think. The compile error is occurring in .c files that reference the bool type. As I recall, C does not support bool (C++ does). If you compile for an Arudino UNO, the IDE compiles .c files with g++ with no errors. For Teensy, the IDE compiles .c files with gcc and gives the compile error. There might be some command line option for gcc that will support bool, but I don't know what it is. I got your simple Temboo sketch to compile on T3.6 by renaming a couple of .c files in the Temboo lib to .cpp. Specifically, in arduino-1.8.10/libraries/Temboo/src/utility/
mv TembooWebSocketRequestHandles.c TembooWebSocketRequestHandles.cpp
mv TembooGPIO.c TembooGPIO.cpp


I don't know if that will cause other problems, but sketch compiles.

#include <stdbool.h> defines bool for C programs ... a messy fix for Temboo lib
 
Last edited:
The ARM compiler shipped with Arduino 1.8.10 is version 5.4.1 which was released in June 2016. The AVR compiler is 7.3.0 which was released in January 2018. The current GCC compiler is 9.2.0 which was released in August 2019. GCC 10 will likely be released in a couple of months (we are currently at stage3 of development). As GCC 10 comes out, the GCC 7.x branch will be frozen (GCC 5.x was frozen much earlier).
 
The ARM compiler shipped with Arduino 1.8.10 is version 5.4.1 which was released in June 2016. The AVR compiler is 7.3.0 which was released in January 2018. The current GCC compiler is 9.2.0 which was released in August 2019. GCC 10 will likely be released in a couple of months (we are currently at stage3 of development). As GCC 10 comes out, the GCC 7.x branch will be frozen (GCC 5.x was frozen much earlier).

@MichaelMeissner - was this aimed at this thread? :: forum.pjrc.com/threads/58695-c-17
 
No it was meant to say that the ARM compiler is older than the AVR compiler, and there might be things that the newer compiler provides by default. I do tend to agree that including stdbool.h is probably the right solution. I just didn't have time to dig in exactly where bool is defined in the AVR world.

Opps - missed the connection … and misread.
 
No it was meant to say that the ARM compiler is older than the AVR compiler, and there might be things that the newer compiler provides by default. I do tend to agree that including stdbool.h is probably the right solution. I just didn't have time to dig in exactly where bool is defined in the AVR world.

Well, on linux-64 1.8.10/1.48 I see that IDE build is using gcc for .c files for UNO, DUE, ZERO, adafruit circuit express(SAMD21), M4 (SAMD51), and there is no error for .c files using bool. So the non-Teensy builds must have bool defined in some default include path. I did not see any magic gcc command line switches.

Another data point, compile fails for Teensy 2.0 as well as Teensy 3* , Teensy 4
 
Status
Not open for further replies.
Back
Top