Has anyone noticed that nvcc’s error print format is just slightly different from gcc’s?
$ gcc -o test test.c
test.c: In function â€˜mainâ€™:
test.c:3: error: â€˜aâ€™ undeclared (first use in this function)
test.c:3: error: (Each undeclared identifier is reported only once
test.c:3: error: for each function it appears in.)
medwick:test joaander$ mv test.c test.cu
medwick:test joaander$ nvcc -o test test.cu
test.cu(3): error: identifier "a" is undefined
Note that there are parentheses around the line number in nvcc’s output. This annoyingly makes IDEs (like XCode) interpret that line as random stdout junk and not an file:line error indicator, and thus the cool GUI features for going to errors are not enabled.
Does anyone know if there is a hidden command line option for a gcc-compatible error format? Or is the only option a hackish perl nvcc replacement that translates the error formats?
Now works ok with QtCreator as far as I can tell. It is just a hack so it will break for weirdly named files and so on (but then the whole console-based compiler-IDE interface is an ugly hack anyway… bring on clang!)
For usability issues such as this, please feel free to file a request for enhancement (RFE) against the compiler through the bug reporting mechanism which is linked from the registered developer website.
As an old-school makefile user I have no knowledge of IDE-to-commandline interfaces but could imagine that different IDEs have different requirements for error message formats, in which case one format may not satisfy all commonly used IDEs.