Adding path information for include files in source code

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

Adding path information for include files in source code

2,032 次查看
guenter_loettrich
NXP Employee
NXP Employee

Hi,

is there a possibility in MCUXpresso to add (relative) path information about include files directly in source code without specifying the path information in the settings?

Like the following:

#include "../test.h"

This "../" operator should indicate a location one level above the actual path. That seems to work with certain IDEs but not with MCUXpresso Eclipse according customer feedback.

br

Guenter

 

0 项奖励
回复
1 回复

2,024 次查看
ErichStyger
Specialist I

Hi @guenter_loettrich ,

yes, I'm doing this kind of things all the time, and it works perfectly.

Keep in mind that the include search order is not defined by the IDE, but the tool chain itself (GNU/ARM toolchain). And that that for relative paths it gets appended/searched from the given include (-I) options.

So that path to your "../test.h" needs to be present in the -I options list. So the 'relative' path is in fact 'relative to the given include search paths'.

The other thing to keep in mind with relative search paths for the compiler is that it uses the 'build output folder' (usually 'debug') as the cwd of the executable. This however is depending on the launcher/build system of the executable (i.e. IDE), so it won't be the same for every build system.

Or in other words: your "one level above the actual path" is not defined. There is no such thing like 'actual path'. Maybe this is your issue?

I hope this helps,

Erich

 

0 项奖励
回复