Building 16.10.1.m3 for FX30 R14

Hiya,

Just a quick heads up if you’re trying to build legato 16.10.1.m3 for the FX30.

I had a number of build errors appear when trying to build … along the lines of:

/home/developer/legato-16.10.1/framework/tools/mkTools/parser/apiParser.h:27:10: error: ‘std::function’ has not been declared
     std::function<void (std::string&&)> handlerFunc ///< Function to call with dependencies.
          ^~~~~~~~

while trying to build the build tools.

After a lot of bad words, I realised that sometime since I had previously built 16.10.1 I had updated the host gcc to version 7.3.0 from version 5.4.0 (which appears to be the default in Ubuntu 16.04 LTS).

So … there is a fix to get 16.10.1.m3 to build with the later version of gcc:

  1. change to the directory where you unpacked the 16.10.1.m3 source (I’ll refer to it here as ~/legato-16.10.1.m3

  2. open ~/legato-16.10.1.m3/framework/tools/mkTools/ninja-generator in your favourite text editor

  3. Go to line 35 and change the compiler flags from

    COMPILER="g++ -std=c++0x"

to

    COMPILER="g++ -std=c++11"
  1. Save and close ninja-generator

  2. open ~/legato-16.10.1.m3/framework/tools/mkTools/mkTools.h in your favourite text editor

  3. go to line 29 and insert the line:

#include <functional>
  1. save and close mkTools.h

  2. change to the top of the legato build directory (cd ~/legato-16.10.1.m3)

  3. run make wp85

The legato framework should now build correctly.

Seems to work for me … hopefully it works for others too.

ciao, Dave

1 Like

Hi @davidc,
Thanks for sharing your findings!
BR,
Chris

@davidc,

It was really nice to share such findings.
Is it possible for such Information post to be easily distinguished compared to other posts done for querying.
This is a suggestion …

Thanks,
Vasantha

Hi @Vasantha_lax

Glad the info was of use to someone else!

Maybe the forum moderators can tag this as a sticky for the time being?

ciao, Dave