weixin_39799561
2020-12-30 03:36 阅读 25

Build error. cstdlib: no such file or directory

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>
</cstdlib>

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

该提问来源于开源项目:andysworkshop/stm32plus

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

11条回答 默认 最新

  • weixin_39799561 weixin_39799561 2020-12-30 03:36

    Solved. Need add folder with cstdlib in include path.

    点赞 评论 复制链接分享
  • weixin_39992483 weixin_39992483 2020-12-30 03:36

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

    点赞 评论 复制链接分享
  • weixin_39799561 weixin_39799561 2020-12-30 03:36

    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?

    点赞 评论 复制链接分享
  • weixin_39866487 weixin_39866487 2020-12-30 03:36

    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
    
    点赞 评论 复制链接分享
  • weixin_39799561 weixin_39799561 2020-12-30 03:36

    , thanks. It works.

    点赞 评论 复制链接分享
  • weixin_39866487 weixin_39866487 2020-12-30 03:36

    Which method did you use?

    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.

    点赞 评论 复制链接分享
  • weixin_39799561 weixin_39799561 2020-12-30 03:36

    I'm install this version:

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

    点赞 评论 复制链接分享
  • weixin_39992483 weixin_39992483 2020-12-30 03:36

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

    点赞 评论 复制链接分享
  • weixin_39866487 weixin_39866487 2020-12-30 03:36

    It's specific to Ubuntu 14.04+.

    点赞 评论 复制链接分享
  • weixin_39766867 weixin_39766867 2020-12-30 03:36

    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.

    点赞 评论 复制链接分享
  • weixin_39525865 weixin_39525865 2020-12-30 03:36

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

    点赞 评论 复制链接分享

相关推荐