iar
iar copied to clipboard
IAR system include path should be place at the end of includePath in c_cpp_properties.json
As the IAR official development guide description:
If the compiler encounters the name of an #include file in angle brackets, such as: #include <stdio.h> it searches these directories for the file to include: 1 The directories specified with the -I option, in the order that they were specified, see -I, page 282. 2 The directories specified using the C_INCLUDE environment variable, if any, see Environment variables, page 251. 3 The automatically set up library system include directories. See --dlib_config, page 276.
the compiler will search the header in the path that user configured in the project firstly. If I write the header file "errno.h" in my project, I find that the vscode cannot find the correct header file in my project; instead it find the file provided in the IAR system path. so it is recommended to list the system include header at the end of includePath in c_cpp_properties.json