Home
Support

Knowledge Base

BSPs and drivers
Community resources
Product documentation
Questions?
Contact us

public.h or similarly named header file results in compilation errors
 
________________________________________________________________________

Applicable Environment
________________________________________________________________________
  • Topic: public.h or similarly named header file results in compilation errors
  • SDP: 6.4.0, 6.4.1
  • Host: Any supported host
________________________________________________________________________

Solution
________________________________________________________________________

As of 6.4.0 and 6.4.1, the creation and attempted use of a header file that begins with the string 'public' results in a compilation error using command line 'make' or the IDE's build system.
This can be very easily tested/reproduced making a header file named 'public1.h' and including it in a very simple 'test.c' project and then trying to build that project using the command line make tool. This results in the following build error:
---
C:\QNX641\host\win32\x86\usr\bin\make -k all
--file=C:/DOCUME~1/user/LOCALS~1/Temp/QMakefile126822197273414112.tmp
C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Cx86 -fMakefile all
make[1]: Entering directory `C:/ws46/test/x86'
C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Co -fMakefile all
make[2]: Entering directory `C:/ws46/test/x86/o'
C:/QNX641/host/win32/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall
-Wc,-Wno-parentheses -O -DNDEBUG -I. -IC:/
ws46/test/x86/o -IC:/ws46/test/x86 -IC:/ws46/test -IC:/ws46/test/public1.h
-IC:/QNX641/target/qnx6/usr/include -
DBUILDENV_qss C:/ws46/test/test.c
cc1: error: C:/ws46/test/public1.h: not a directory
cc: C:/QNX641/host/win32/x86/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.3.3/cc1 caught
signal 1
make[2]: *** [test.o] Error 1
make[2]: Target `all' not remade because of errors.
make[2]: Leaving directory `C:/ws46/test/x86/o'
make[1]: [all] Error 2 (ignored)
C:/QNX641/host/win32/x86/usr/bin/make -j 1 -Co-g -fMakefile all
make[2]: Entering directory `C:/ws46/test/x86/o-g'
C:/QNX641/host/win32/x86/usr/bin/qcc -Vgcc_ntox86 -c -Wc,-Wall
-Wc,-Wno-parentheses -I. -IC:/ws46/test/x86

/o -IC:/ws46/test/x86/o-g -IC:/ws46/test/x86 -IC:/ws46/test
-IC:/ws46/test/public1.h -IC:/QNX641/target/qnx6/usr/include

-g -DVARIANT_g -DBUILDENV_qss C:/ws46/test/test.c
cc1: error: C:/ws46/test/public1.h: not a directory
cc: C:/QNX641/host/win32/x86/usr/lib/gcc/i386-pc-nto-qnx6.4.0/4.3.3/cc1 caught
signal 1
make[2]: Leaving directory `C:/ws46/test/x86/o-g'
make[2]: *** [test.o] Error 1
make[2]: Target `all' not remade because of errors.
make[1]: [all] Error 2 (ignored)
make[1]: Leaving directory `C:/ws46/test/x86'
---

A possible solution for this issue which has been tested and shown to work is to " remove the asterisks (wildcard characters) from both paths in the defpublic_invcpath definition." The file located on a 6.4.0 Windows environment at C:\QNX640\target\qnx6\usr\include\mk\qmacros.mk can thus be altered.

This issue has been raised in PR# 75361 and a official resolution with full testing is pending.

________________________________________________________________________
NOTE: This entry has been validated against the SDP version listed above. Use caution when considering this advice for any other SDP version. For supported releases, please reach out to QNX Technical Support if you have any questions/concerns.
________________________________________________________________________


Related Attachments
 None Found





Please contact us with your questions or concerns.