lcc preprocessor error with angle brackets inclusion of files

Hi,
I am trying to compile C code in MATLAB using LCC.
I have the C code with files included using angle brackets such as
#include < x.h >
The pre-processor is throwing errors (in lines where ever this is the case) thereby saying
Error using ==> mex at 206 Unable to complete successfully.
Could you help on how to resolve this..?
Thanks, Papi R.

7 Comments

What error message is given? And does the error go away if you change the angle brackets to double-quotes ?
The error message is 'lcc preprocessor could not find file x.h'.
The error message did go away if I change the angular brackets to " ".
Your file x.h is in your current directory rather than being in a "system" directory or otherwise along the -I include paths.
my file x.h is in the same, i.e. in current directory.
The angle-bracket notation means do not look in the current directory, only look along the include path, so lcc is processing the files correctly.
are there any options to set, giving the same direction to the lcc with angle brackets too.. i.e. look in the same directory.
I know this is working for my colleagues. Just that they are away on the week-end I am looking for some quick guidance.
You could try adding -I. (dash capital-eye period) to the compiler flags. You might need a space after the -I
When something like this happens it usually indicates that the source code was copied into a directory that was only intended to hold include files.

Sign in to comment.

Answers (1)

Jan
Jan on 11 Nov 2012
Edited: Jan on 12 Nov 2012
As Walter has explained already, using < and > means, that the file is searched in standard list of system directories. See http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html.
[EDITED] I do not see a reason to run #include outside the specifications: < and > for system headers, double quotes for user-defined headers. If #include x.h works on the computer of your colleagues, they have added the folders of user-defined headers to the system path. Besides confusing the system, this methods confuse you also, because your system is still clean. Do not follow their example.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products

Asked:

on 11 Nov 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!