• Welcome to Andy's Workshop Forums. Please login or sign up.
 
April 23, 2024, 03:40:17 am

News:

SMF - Just Installed!


Standard library includes

Started by Ozflip, September 01, 2014, 08:16:20 am

Previous topic - Next topic

Ozflip

September 01, 2014, 08:16:20 am Last Edit: September 01, 2014, 08:18:23 am by Ozflip
I'm trying to follow the instructions for the library version 3.4.0 following the install.md file.

After everything is installed (fresh Ubuntu 14.04 install with just the STM32Plus library and prerequisites - I used the recommended arm cross-compiler) I started building with ..

scons mode=debug mcu=f4 hse=8000000 float=hard

... and almost immediately it throws...

In file included from examples/adc_analog_watchdog/adc_analog_watchdog.cpp:7:0:
lib/include/config/stm32plus.h:171:19: fatal error: cstdlib: No such file or directory
#include <cstdlib>

I'm guessing it can't find the headers for the standard libraries, but where would it be looking for them? And how do I tell scons where to find them?

Thanks - Phil.


Andy Brown

Hi Phil, sorry for the late reply but I've been away and off the internet for a week.

cstdlib is a fundamental c++ header file so it sounds like your environment has something set that's directing the compiler to a different location for its includes. Firstly, let's check your compiler is coming from the right place. Execute which arm-none-eabi-g++ at the command line to verify that you're running the compiler that you think you are.

Assuming that's correct, check your environment for variables that could be overriding the default include search path and review the gcc search path and environment variable documentation to see if you've got anything set that could be interfering with your build environment.
It's worse than that, it's physics Jim!

Ozflip


Ozflip

'which' returns the correct gcc-arm install.

I installed your recommended Launchpad cross-compiler, but I used the ppa for Ubuntu from Terry Guo (it's recommended on the Launchpad homepage) and it looks like it installs the compiler and nothing else (at least, if it does install the includes and libraries I have no idea where they get put).

Sorry to ask such trivial questions, but I'm a Linux noob.

So, if I use the proper launchpad tarball, where would you recommend that I unpack it to?

Phil

Andy Brown

It doesn't matter where you extract the tar archive to - I use a subdir off my home directory. Then all you need to do is add the extracted bin directory (the one with arm-none-eabi-g++ in it) to your personal PATH environment variable and that should do it. The compiler looks for everything relative to its own directory.
It's worse than that, it's physics Jim!

Ozflip

Thanks Andy - that did it (after figuring out how to permanently modify the PATH env variable in Ubuntu 14!)

Why can't the readme for the tarball have that simple instruction? It's probably obvious to those who use Linux all the time, but us poor noobs, you know.. :)