Copyright ©

Mongoose OS Forum

ATTENTION! This forum has moved to:

Do not post any new messages.

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.


  • ulsoulso Stockholm

    Works fine on ESP32 though, so I guess the build system for CC32xx is just lagging behind a bit in the support for C++.

  • ulsoulso Stockholm

    Is there a way to specify another toolchain when building locally?

Sign In or Register to comment.