Using C++ Boost library on ESP32 - RTTI Error

ogensyts
Posts: 9
Joined: Fri Jan 05, 2018 2:41 pm
Location: Quebec, Canada

Using C++ Boost library on ESP32 - RTTI Error

Postby ogensyts » Fri Mar 30, 2018 3:33 am

Hi,

i am trying to use Boost library on my ESP32 and get this error on Boost files when issuing 'make' :

Code: Select all

 .... error: cannot use typeid with -fno-rtti
With this command on the terminal :

Code: Select all

user@ubuntu:~$  xtensa-esp32-elf-gcc-5.2.0 -v
I can see configured with

Code: Select all

.... --enable-cxx-flags='-fno-rtti ....
Can i remove this flag when issuing 'make' on my code to remove this error with Boost? If so how can i do it?
Or is it bad to do so ?

I am using Boost 1.53

Regards,
ogensyts

User avatar
PaulVdBergh
Posts: 58
Joined: Fri Feb 23, 2018 4:45 pm
Location: Brasschaat, Belgium

Re: Using C++ Boost library on ESP32 - RTTI Error

Postby PaulVdBergh » Fri Mar 30, 2018 11:08 am

Hi,

I have no experience with the boost libraries, but had the same isue with a dynamic_cast<>(). I solved it by adding the following line to the component.mk file:

Code: Select all

CXXFLAGS += -frtti
Hope this helps.

Paul.

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Using C++ Boost library on ESP32 - RTTI Error

Postby snahmad75 » Sat Apr 28, 2018 9:43 pm

Can we use boost on ESP33. Does all boost libraries work on Esp32. Does it fit under 1MB Flash?

ogensyts
Posts: 9
Joined: Fri Jan 05, 2018 2:41 pm
Location: Quebec, Canada

Re: Using C++ Boost library on ESP32 - RTTI Error

Postby ogensyts » Fri Jul 06, 2018 5:12 am

To answer your question snahmad75, no you cannot. To give one example, Boost uses a different threading system which is not compatible with ESP32's FreeRTOS. The project will not compile.

malachib
Posts: 17
Joined: Tue Aug 28, 2018 9:06 am

Re: Using C++ Boost library on ESP32 - RTTI Error

Postby malachib » Tue Aug 28, 2018 9:10 am

It's definitely not the same as boost, but I been working on 'estd' library, providing bits and pieces of std lib functionality and works on embedded targets.

Located https://github.com/malachi-iot/estdlib

Who is online

Users browsing this forum: Bing [Bot], Rckyan and 108 guests