Hello, My name is john. I'm currently building cross-compile environment with visual studio code.
With Variscite's document and NXP's i.MX Porting Guide, I successfully built user-space application cross-compile environment with visual studio code.
The following links are what I referred.
Variscite's document
https://variwiki.com/index.php?title=Yocto_Programming_with_VSCode&release=RELEASE_HARDKNOTT_V1.0_DA...
NXP's document (2.1.1 How to build and load Kernel in standalone environment)
https://www.nxp.com/docs/en/user-guide/IMX_PORTING_GUIDE.pdf
I want to build device driver with the same method, but I have difficulties about setting kernel headers.
When I bitbake, I added the following to my recipe to include kernel source to sdk which generated by populate_sdk.
TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc"
I made dummy device driver 'dummy.c' in https://github.com/PacktPublishing/Mastering-Embedded-Linux-Programming-Second-Edition/blob/master/C...
With dummy.c, I run 'make' and VScode show me lots of errors. I think I have to match kernel header carefully, but I don't know how to do.
The following figure is errors which VScode shows to me.

The following figure is my c_cpp_properties.json in VScode and my SDK's location is '/opt/fsl-imx-wayland/4.14-sumo/sysroots/aarch64-poky-linux/*'.

The following figure is my Makefile in VScode.

Thanks for your help.