- 15th March 2014 at 5:47 pm #64644
Is there a tool in the MetaFlow SDK that allows one to compile C++ code for the minimorph?17th March 2014 at 9:33 am #64652
Yes, but it’s not enabled by default.
Enable it under “Toolchain” -> “Toolchain has C++ support?”
Rebuild buildroot and it should be available.
Sean.19th March 2014 at 7:41 pm #64651
Thanks I will give it a go19th March 2014 at 8:03 pm #64650
I assume one then compiles the C++ code by entering the following into a makefile:
$(CROSS_COMPILE)cpp $(TARGET_LDFLAGS) -g -o $@ $^
19th March 2014 at 8:19 pm #64649
when I use the syntax above in a Makefile and try to compile a simple “hello,world” application, I get the following error:
/home/kipchirchir/Meta-Linux-SDK/GPL/buildroot/output/host/usr/bin/metag-linux-cpp -g -o test test.cppI have both g++ and build-essential installed on my machine. Is there anything further I need to do to compile the C++ code or did I not follow your previous instructions properly?
metag-linux-cpp: test.cpp: C++ compiler not installed on this system
make: *** [test] Error 1
Thanks20th March 2014 at 1:04 pm #64648
Are you trying to compile on the Minimorph itself or on your host machine?
Have you set up your CROSS_COMPILE environment variable?20th March 2014 at 3:10 pm #64647
On investigation, it looks like you are calling the wrong file from your makefile.
Check in your buildroot/output/host/usr/bin/ directory for a file called metag-linux-g++
If that is there, then you’ve managed to rebuild buildroot with C++ support.
Then in the your makefile, replace the cpp with g++ as below
$(CROSS_COMPILE)g++ $(TARGET_LDFLAGS) -g -o $@ $^22nd March 2014 at 6:51 pm #64646
I properly rebuilt the buildroot directory by first calling:
makeThe C++ code compiled successfully, however, when i try to run the code on the minimorph, I get the following error:
./testcpp: can't load library 'libstdc++.so.6'I have tried reflashing the board but the error still persists. Would I need to rebuild the linux kernel and adding certain modules?
Thanks24th March 2014 at 3:37 pm #64645
You could try linking statically to to libstdc++.so by recompiling your app with the -static-libstdc++ gcc option.
Forums are currently locked.