Mkapp stopped working

Hello,
I’m trying to build a legato application I just wrote, but whenever I run the mkapp command I get the following error:

mkapp: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by mkapp)

running strings /usr/lib/libstdc++.so.6 | grep GLIBCXX I got this:

GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH

It was working with no issues a couple of weeks ago and I don’t know what happened. I tried every solution I could find by googling the error, but none of them worked. Any suggestions?
Thank you!

I had similar issue on Ubuntu 12, I remember I did this:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libstdc++6

Thank you very much for your reply. I have tried the procedure you suggested, but now I’m getting the following error

mkapp: relocation error: mkapp: symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EPKcRKS3_, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

How can I solve this?

not sure if you need to recompile the whole legato framework.
You can do the following in the leaf shell:


make clean
make wp76xx

I get the exact same error as a result of make wp76xx

you can see here:

I cannot upgrade Ubuntu. For project requirements I need to use Ubuntu 14.04. I was looking at this solution:

add -D_GLIBCXX_USE_CXX11_ABI=0 (cmake example) flag (if you go this way, you should add this flag to every makefile or project you build till you upgrade ubuntu or downgrade gcc)

but I don’t understand where to put that flag and how. I tried to add CFLAGS := $(CFLAGS) -D_GLIBCXX_USE_CXX11_ABI=0 into the makefile but it is not working (still getting the same error).

As far as the gcc downgrade, I’m using version 4.8. Is it safe to downgrade even more? How can I do it?

See if this helps