1822 views|1 replies

3836

Posts

19

Resources
The OP
 

IAR for MSP430 Two methods of adding custom header files [Copy link]

When using the new version of IAR5.31, I found that the header file could not be added. I thought about the similar problem I encountered when I used it at that time. I don’t know how to solve it in the end. When adding it using the workspace bar, it can be added, but it is no longer in the main sub-directory. Even if the xxx.h file is included, it will still prompt "can no find xxx.h" when compiling. So I searched for relevant IAR tutorials on the Internet and compared them with previous projects, and summarized two solutions. Method 1: Save the header file xxx.h in the current project directory, usually in the same directory as main.c. At this time, there is no need to add it manually in the workspace. You only need to "#include xxx.h" in main.c or in the corresponding xxx.c file. After the compilation is successfully completed, it will automatically appear in the corresponding .c file to indicate that the .c file calls the .h file. Method 2: The file arrangement in method 1 is a common file organization method. However, when there are many files, .c and .h files are mixed together, which makes the number of files large and messy. At this time, you can right-click the Debug item in the workspace, add --> add group, as shown in the figure. You can add folders such as Resource and Head to classify .c and .h files.

This post is from Microcontroller MCU

Latest reply

I copied and pasted it from somewhere else, so there is no picture.  Details Published on 2018-12-25 08:46
 

6366

Posts

4929

Resources
2
 
I copied and pasted it from somewhere else, so there is no picture.
This post is from Microcontroller MCU
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list