MCUXpresso Library Include Issue

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MCUXpresso Library Include Issue

跳至解决方案
2,240 次查看
michaelc77
Contributor II

I am trying to create a project that will contain FreeRTOS, FATFS, LWIP, etc. A separate library will contain my application firmware.

I used the FreeRTOS Hello World example for board init calls. I took the task it creates and placed it in my library main. The library has includes through the IDE to the project that contains my SDK elements. This part of the project works fine.

I then add LWIP through the SDK GUI to my main project. My code will then compile fine with just LWIP added, but not used. I added the #includes to my library and I make sure to have includes to the LWIP header files in my main project (via C/C++ Build->Settings->MCU C Compiler->Includes). When I go to compile, my console says that no such file or directory exists (see below error). If I go to my main project, I can right click and do an open declaration and it will open the header file. I have tried deleting the "LWIP/" part of the #include, and that does make a difference, but it will regenerate when I add anything from the SDK GUI.

C:\Users\michaelc\Documents\MCUXpressoIDE_11.0.0_2516\workspace\Test_Project_freertos_hello\lwip\src\include\lwip/api.h:40:10: fatal error: lwip/opt.h: No such file or directory
#include "lwip/opt.h"

Has anyone seen this issue before? Any help or advice is greatly appreciated.

标签 (1)
标记 (1)
0 项奖励
1 解答
1,979 次查看
converse
Senior Contributor V

I've had a quick look at your project...

The issue is that you do not have the correct include paths listed.

To illustrate the issue, here is an imaginary scenario.

Organisation of files

- source

-- include

--- lwip

---- header.h

In your source file:

(1) #include "lwip/header.h"

Then your include path needs to add

(2) source/include

and NOT

(3) source/include/lwip

So, back to your project.

It is not clear what you have changed in the supplied sources (hint - do not change any of it!), but you now seem to have a mixture of (1), (2) and (3) (above). SO, I suggest that you return the source code to how it was supplied and then add the correct include path directories, like (2) above, not like (3).

Hope that helps.

在原帖中查看解决方案

2 回复数
1,980 次查看
converse
Senior Contributor V

I've had a quick look at your project...

The issue is that you do not have the correct include paths listed.

To illustrate the issue, here is an imaginary scenario.

Organisation of files

- source

-- include

--- lwip

---- header.h

In your source file:

(1) #include "lwip/header.h"

Then your include path needs to add

(2) source/include

and NOT

(3) source/include/lwip

So, back to your project.

It is not clear what you have changed in the supplied sources (hint - do not change any of it!), but you now seem to have a mixture of (1), (2) and (3) (above). SO, I suggest that you return the source code to how it was supplied and then add the correct include path directories, like (2) above, not like (3).

Hope that helps.

1,979 次查看
michaelc77
Contributor II

Thank you. I think I was confused with the IDE saying the #include was broken in my main project and not in the library. I added the paths correctly in my library and it compiles fine.

0 项奖励