Copyright ©

Mongoose OS Forum


Lambda expressions not working when using C++ for CC3220

ulsoulso Stockholm

I was trying to use lambdas in my main.cpp file like this:

mgos_set_timer(5000, MGOS_TIMER_REPEAT, [](void *arg) {
   LOG(LL_INFO, ("Tick"));
}, NULL);

But that didn't work. It seems that the TI compiler which is used for compiling for CC32xx is a bit old.
When I add the extra --cxxflags-extra -version to the command line when building, the TI compiler reports
its version as v16.9.9.LTS, which to my knowledge means that it supports C++03 only, hence no support for lambdas or any other of the new C++ goodies.

How about using the v18.12.0.LTS instead, which supports C++14? I would very much appreciate that.


Sign In or Register to comment.