andysworkshop / stm32plus

The C++ library for the STM32 F0, F100, F103, F107 and F4 microcontrollers

Home Page:http://www.andybrown.me.uk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build error. cstdlib: no such file or directory

MaxMelekesov opened this issue · comments

Hi.
I try to build the library, but get an error:

../stm32plus.h:147:19: fatal error: cstdlib: No such file or directory
#include <cstdlib>

I installed gcc-arm-none-eabi and scons.
What could be the problem?

Solved.
Need add folder with cstdlib in include path.

You shouldn't need to add anything - gcc knows where its standard headers are. There's something not right with your compiler installation.

I'm install gcc as here:
https://travis-ci.org/andysworkshop/stm32plus/jobs/110735759

sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded -y
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi

Where I could make a mistake?

As explained on the PPA page, the version numbers are such that Ubuntu Trusty's version of gcc-arm-none-eabi takes priority over the one from Terry Guo. You can resolve this one of two ways: First, specify the exact version to install:

sudo apt-get install gcc-arm-none-eabi=4.9.3.2015q1-0trusty13

Or use my PPA, which has the versions backported from Xenial, which do have superseding version numbers, and then also install the C++ stdlib:

sudo add-apt-repository ppa:mikepurvis/stm32-staging -y
sudo apt-get update
sudo apt-get install gcc-arm-none-eabi libstdc++-arm-none-eabi

@mikepurvis, thanks. It works.

@wheresmymind Which method did you use?

@andysworkshop Might be worth a note about this in the README. Not sure how many other Ubuntu users you have, but this is a non-obvious pitfall to navigate.

I'm install this version:

sudo apt-get install gcc-arm-none-eabi=4.9.3.2015q3-1vivid1

@mikepurvis I can add a note in the README. Is this a situation unique to Ubuntu users or is it for all Linux distros?

It's specific to Ubuntu 14.04+.

Don't say that. I'm not 100% sure, but on Fedora you can install the
compiler without the stdlib for arm (which makes... sense, at least a
little bit).
So, just mention it in the Readme.

On Ubuntu 17.10 I needed to install:
sudo apt-get install libstdc++-arm-none-eabi-newlib