Bricxcc include paths: current dir (variable) and a static?

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Bricxcc include paths: current dir (variable) and a static?

Post by HaWe »

how can I set 2 include paths in Bricxcc:

1st, always search in the current .nxc program directory where the main file is (if include file found, ingnore the rest),
e.g. G:\Akten\Programmierung\NXC\test or G:\Akten\Programmierung\NXC\project or G:\Akten\Programmierung\NXC\chess

2nd, if not in current dir: look at a static include directory,
e.g. like G:\Akten\Programmierung\NXC\include

:?:
afanofosc
Site Admin
Posts: 1256
Joined: 26 Sep 2010, 19:36
Location: Nashville, TN
Contact:

Re: Bricxcc include paths: current dir (variable) and a static?

Post by afanofosc »

I am not sure I understand the question, since afaik, what you describe is how the compiler is supposed to work wrt include paths. It should always check the same directory as the file being compiled first and then any of the specified additional include paths. You can use a semi-colon separated list of paths. In theory, "." should work for "original source code path" but I am not 100% certain about that. BricxCC saves the file you want to compile to the %TEMP% folder and it is not impossible that this is causing include file path problems in some cases. I have not personally ever had a problem with including a file that is in the same directory as the original source code, however.

John Hansen
Multi-platform LEGO MINDSTORMS programming
http://bricxcc.sourceforge.net/
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Bricxcc include paths: current dir (variable) and a static?

Post by HaWe »

what I tried was:
having a file "nxcio.h" in the "...\include folder". It worked.
having a file "nxcio.h" in the "." folder but NOT in the "...\include" folder: It worked NOT, file was not found - But "." wasn't additionally specified as an include path
(I tried
.
it was not accepted
but didn't try
"."
(included in colons? or quotes? - or how is it called?)
)

What will the compiler do if in "." is such a file as well as in "...\include" ? which one will he take?
(do you say "he" or "it" related to "the compiler"?)
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests