I had recently purchased a couple VL53L0X series Distance Sensors from STMicroelectronics and when working on them I was pleased to see that the company offered an API in order to easily read in the measurements. However I ran into a few problems with getting the API implemented into a Keil Project.
Here's the current File Structure:
The folder downloaded from with the API has been placed right under my C: drive in this directory: C:\Keil_v5\APIs\VL53L0X_1.0.2\Api
The children folders of the API folder is as follows: ../core/inc , ../core/src , ../platform/inc , ../platform/src
In my Keil project, following an example provided by STMicroelectronics, I include the 'vl53l0x_api.h' file located in /core/src folder. I also have the C/C++ include paths to look in all of the folders inside of the Api folder.
However the issue arises when I attempt to compile the code. A few of the files in the API try to include the 'Windows.h' file but are unable to find them.
Naturally I am missing the include path to the Windows SDK and that particular header, however when I add 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um' folder to the Include Paths variable, because of the space between 'Program' and 'Files' ( I believe ) the compiler errors out stating:
Error: C4065E: type of input file 'Files' unknown
So to resolve this, I ended up copy the folder with windows.h into a folder inside the API folder, but that lead to another file in a folder which in turn lead to another file and then another etc. Point is that definitely can not be the way its supposed to be implemented.
There has to be something major, yet small, that I am missing but any input would be must appreciated. But I guess my question in short would be is there a Pack that anyone knows of with these dependencies or some better way to point Keil to where to read the 'windows.h' file and it's dependencies?
This is all being ran uVision V5.16a. Currently FreeRTOS is added to the project and I plan on adding the HAL Library for the STM32F4xx board that this will be ran on.
-Thank you and All the Best, Kevin
Don't ST provide an example project?
As the code comes from ST, have you contacted ST for support?
https://community.st.com/s/
It's better to post the build output as text - not a picture.(post as for source code)
If it's asking for windows.h, that suggests it thinks you're building for a Windows Host system - so presumably there is some configuration required to get it to build for a microcontroller Target system?
Again, ST would be the ones to ask about that - as it's their software..
KevinM said: I add 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um' folder to the Include Paths
KevinM said:Error: C4065E: type of input file 'Files' unknown
probably due to the space in "Program Files" ?
I think this goes back to Windows Host issue - you need to sort that before worrying about anything else.
So I guess we're talking about this:
https://www.st.com/en/imaging-and-photonics-solutions/vl53l0x.html
https://www.st.com/content/st_com/en/products/embedded-software/proximity-sensors-software/stsw-img005.html
Under 'Key Features', it says:
"Several examples (running on the PC) showing how to use API to perform ranging measurements with Nucleo F401 and VL53L0X expansion boards."
Which does further suggest that you're trying to build the PC Host stuff ...
Well in many ways that's quite the relief because I was worried about how much memory was being used. Thank you for steering me in the right direction!