Archived
This forum has been archived. Please start a new discussion on GitHub.
slice2cpp: .cpp file includes .h file using system-style header inclusion ( < > brackets)
philip_lamb
Christchurch, New Zealand
in Bug Reports
The auto-generated cpp file output by slice2cpp includes its header using system-style header inclusion ( < > brackets). This causes problems when compiled via clang, as clang expects user headers to be included via quotes only.
Two workarounds:
1. Manually edit the .cpp file after every time slice2cpp is run.
2. Specify the directory holding the .h file as a system header path to clang (with -isystem command line option).
0
Comments
-
Hi Philip,
Which clang version do you use?
It works for me with clang form the command line tools:
$ mkdir -p include/A $ touch include/A/A.h $ echo "#include <A/A.h>" > foo.c $ clang -c foo.c foo.c:1:10: fatal error: 'A/A.h' file not found #include <A/A.h> ^~~~~~~ 1 error generated. $ clang -Iinclude -c foo.c $ clang -v Apple LLVM version 9.0.0 (clang-900.0.38) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/binCheers,
Benoit.0
