Conditional include with non existing headers

92 views
Skip to first unread message

Edoardo Cipriano

unread,
Aug 29, 2024, 10:09:14 AM8/29/24
to basilisk-fr
Dear Basilisk Users,

I have a problem with conditional header inclusion using qcc.

Consider a pseudo-program (main.c) like this:

#if BASILISK_SERVER

# include "file1.h"

#else

# include "file2.h"

#endif


int main() {

  return 0;

}


Where file1.h is an empty file,  while file2.h does not exist.

I can compile the code successfully using cc:

cc -DBASILISK_SERVER=1 main.c


But if I use qcc:

qcc -DBASILISK_SERVER=1 main.c


it complains that file2.h does not exist:

main.c:4: error: file2.h: No such file or directory


Is this a problem with qcc?

Thank you for your help.

Edoardo
Reply all
Reply to author
Forward
0 new messages