/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "adc.h"
#include "crc.h"
#include "dma.h"
#include "rtc.h"
#include "usart.h"
#include "gpio.h"
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "luos.h"
/* USER CODE END Includes */
I use a function of this library:
/* USER CODE BEGIN 2 */
luos_init();
/* USER CODE END 2 */
This is the error i have :
Processing eval_f072vb (platform: ststm32; board: eval_f072vb; framework: stm32cube)
-----------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/eval_f072vb.html
PLATFORM: ST STM32 6.0.0 > STM32F072-EVAL
HARDWARE: STM32F072VBT6 48MHz, 16KB RAM, 128KB Flash
DEBUG: Current (blackmagic) External (blackmagic, jlink, stlink)
PACKAGES:
- framework-stm32cube 2.0.181130
- toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 17 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Inc>
| |-- <OD>
| | |-- <Inc>
| |-- <Inc>
Building in release mode
Linking .pio\build\eval_f072vb\firmware.elf
.pio\build\eval_f072vb\src\main.o: In function `main':
main.c:(.text.startup.main+0x26): undefined reference to `luos_init'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\eval_f072vb\firmware.elf] Error 1
============================================================ [FAILED] Took 2.13 seconds ============================================================
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
I don’t understant because VSCode recognize the function but don’t seems compile the library:
This dependency graph looks weird. What’s the folder structure of C:\Users\antoi\OneDrive\Bureau\LUOS\Luos_Dev\Luos and C:\Users\antoi\OneDrive\Bureau\LUOS\Luos_Dev\Robus? If these are directly the library folders, you should try just adding C:\Users\antoi\OneDrive\Bureau\LUOS\Luos_Dev to the lib_extra_dirs and then adding
lib_deps =
Luos
Robus
to the platformio.ini.
However,
Could also come from using C++ code in C in the wrong way. Are your libraries written in C++ or C?
Specifically to see whether they conform to the needed default library structured explain in the README. If not, the creation of library.json is necessary which simply declares the include paths which are missing now. (an example)
This Again . If it’s reproducable I can work on it.
Also are you sure you’re putting your two library.json file in the respective folder of the library?
You should be able to see the new -I flags when you run “Verbose Compilation” (or just pio run -v). If not the library.json is malformed or in the wrong place.
Yes i made a project which reproduce the error
How can i share it whith you ? (it’s a folder containing my library and a platformIO project)
structure of the folder:
-Driver (folder generate by cub_mx)
-Inc(folder generate by cub_mx)
-lib(folder that i create containing LUOS library)
-Project(PlatformIO project)
-Src(folder generate by cub_mx)