qcc preprocessor defines

I want to compile a program with a supplied preprocessor definition:

qcc -DLUA_USERCONFIG=“whatever.h”

and in the program source:
#include LUA_USERCONFIG

but for some reason the preprocessor throws away the quotes ("). I’ve tried other escape characters as well:
‘“whatever.h”’ and &‘whatever’

but none of these work.

I’m using QNX 6.3.0, and I’m compiling using the IDE. So to achieve the above, I open the project properties dialog, and under the ‘Compiler’ tab, in the ‘Definitions’ field, i add the line
LUA_USERCONFIG=“whatever.h”
or in the ‘Other options’ field
-DLUA_USERCONFIG=“whatever.h”

Does QNX qcc use other escape characters for this? How do I define a string enclosed by quotes from the command line?

Hi,

I don’t know if your way is correct. Try this one (I know It’s not same):
In Makefile call:
[color=darkred]qcc -DLUA_USERCONFIG1 …

In your source:
[color=darkblue]#ifdef LUA_USERCONFIG1
#include “whatever1.h”
#endif
#ifdef LUA_USERCONFIG2
#include “whatever2.h”
#endif
#ifdef LUA_U…

     K.

Thanks, but thats not what I’m trying to do. I don’t want to modify the source code at all. I just want to define something with quotes included as part of the definition. Gcc is supposed to support something like -DCONFIG=“stuff” but sometimes the escape character () differs. I just don’t know what it should be for QNX qcc.

Just tried on my machine.

#include MYINC
main()
{
  printf("hello, world.\n");
}

from the command line:
qcc -DMYINC=“stdio.h” -o test test.c
It compiles fine, no errors.

You problem must be due to the IDE. it may have stripped the "

Can you try it directly from the command line (Terminal)?

Are you doing this on Windows? Try this:

qcc -D"o(x)=x" -D"ref(x)=o(#x)" -DDLUA_USERCONFIG=“ref(whatever.h)” myfile.c