VL53l0x api - Page 1
Forum section: electronics / general

author: Tadeuszh
author_rank: Newbie
timestamp: March 25, 2024, 03:44:33 pm
content: Hi there,So im trying to configurate the VL53l0x API, there were multiple errors but i found a tutorial and it helped me so far with getting rid of them. But I'm stuck, I've done everything and I have one final error "fatal error: vl53l0x_api.c: No such file or directory". I have no idea how to solve it, i've added every possible source to the IDE and yet it doesnt work.Have anyone had this kind of issue before?

author: eutectique
author_rank: Frequent Contributor
timestamp: March 25, 2024, 06:23:12 pm
content: I can see/.../Driversand/.../Debug/Drivers/Api/Core/srcmentioned but not/.../Drivers/Api/Core/srcwhere the file is residing. My crystal ball is on maintenance, can't say what your IDE is and how to configure it properly.

author: Tadeuszh
author_rank: Newbie
timestamp: March 25, 2024, 06:47:02 pm
content: I've tried it already, maybe im doing something wrong...

author: eutectique
author_rank: Frequent Contributor
timestamp: March 25, 2024, 06:51:14 pm
content: You are including this file. Do you have the path among the included directories?EditNo, you don't.

author: Tadeuszh
author_rank: Newbie
timestamp: March 25, 2024, 06:55:42 pm
content: Are You asking for this one? I'm sorry im kinda new to this.

author: eutectique
author_rank: Frequent Contributor
timestamp: March 25, 2024, 07:00:42 pm
content: Yes. You are using#includedirective, so the file should be listed among include directories.In the 1s.png screenshot you can see compiler commands, there are include options of the form-I../Core/Incand so on. These are include directories, and you are missing the one which contains your file.

author: Tadeuszh
author_rank: Newbie
timestamp: March 25, 2024, 07:05:46 pm
content: I think i've got it, but um... compiler now warns about 260 errors. It says that the functions are used multiple times, don't really get it, it's and api from the producer of the sensors.

author: Tadeuszh
author_rank: Newbie
timestamp: March 25, 2024, 07:10:50 pm
content: Not sure if the screenshot can be read, it says "Users/mikol/STM32CubeIDE/workspace_1.14.1/uubibiujb/Debug/../Drivers/Api/core/src/vl53l0x_api_strings.c:383: multiple definition of `VL53L0X_get_sequence_steps_info'; ./Api_src/vl53l0x_api_strings.o:C:/Users/mikol/STM32CubeIDE/workspace_1.14.1/uubibiujb/Drivers/Api/core/src/vl53l0x_api_strings.c:383: first defined here" like 260 times. ;/

author: eutectique
author_rank: Frequent Contributor
timestamp: March 25, 2024, 07:16:05 pm
content: Why do you#includethis file into main.c? I guess you should add it to the project source files, so that it will be compiled separately.There is probably a file namedvl53l0x_api.hwhich you are supposed to include?

author: Tadeuszh
author_rank: Newbie
timestamp: March 25, 2024, 07:28:13 pm
content: So i've changed the "#include "vl53l0x_api.c" to "#include "vl53l0x_api.h" as you said and it gives 0 errors! Seems like it's finally working. I dont know why it was "#include "vl53l0x_api.c" in the first place, the guide said that it should be...Thanks a lot man, you are the best!

author: eutectique
author_rank: Frequent Contributor
timestamp: March 25, 2024, 08:42:47 pm
content: Glad I could help you.