IAR and Keil files contain path settings

Source: Internet
Author: User

In modular programming, it is essential to set up a separate header file for a module.

In the two mainstream compilers, it is important to set the accuracy of the file path when referencing the module function, including the path to the header file.

Otherwise, the compiler will error, unable to open such a header file!

Combined with your own experience, summarize how to set the file inclusion path under these two compilations:

The first is the construction of the project, in the actual project folder, there will generally be a project folder to save the actual project, such as the creation of a folder with Project peer driver to save the driver function, driver is divided into Inc and SRC, respectively, to save the driver function of the header file and the source file, and the folder peripheral to save the peripheral driver function, peripheral file is also divided into Inc and SRC, respectively, to save the driver function of the header file and the source file.

Assumptions such as:

Assuming the existing gpio.h in the Driver\inc;

There are iic.h in the peripheral\inc;

"IAR settings include path method"

The following settings are set in the preprocessor in C + + compiler:

1 $PROJ _dir$\driver\inc     2 $PROJ _dir$\peripheral\inc

"Keil settings include Path method"

The following settings are set for Includepath in C + +:

1 .. \driver\inc2 .. \perpheral\inc

IAR and Keil files contain path settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.