2021-10-18 05:28 AM
HI everyone,
As an absolute beginner to STM32, I purchased a Nucleo STM32F411 board.
I'm currently trying to use an online MPU9250 library I found on the internet through: https://github.com/talhaSr/mpu9250
When I tried to import the header and source files into the project, the compiler still cannot find the "mpu9250.h" header file that I manually linked to the list of "includes" and "source".
For reference, here's what I've done so far:
Original Error = stm32_error.png
STM32 Includes = stm32_includes.png (Note the same path is linked to C++ as well)
STM32 Source = stm32_source.png
Could someone please explain if I did anything wrong, or maybe a step by step tutorial?
2021-10-18 06:00 AM
You're compiling a C++ file, but the includes that are shown are for C files. There is a different tab for C++ includes.
2021-10-19 12:29 AM
2021-10-19 07:17 AM
Not real sure.
Are these same directories also listed in C/C++ Build -> Tool Settings -> MCU GCC(and G++) Compiler -> Include paths?
The actual compile command shown in the console used to compile should also show what include directories were used to compile.
2021-10-20 12:22 AM
2021-10-20 07:14 AM
Hmm, I'm not sure what's going on. There has to be a reason it's failing but I can't spot it.
You could always move those files into the Core/Src and Core/Inc directory and build it without needing to add include paths.
2021-10-23 03:15 PM
I finally figured out the issue. I had included the links to those files in the MPU9250 folder, instead of the actual files themselves (I chose the "link files") option.