Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22113

How can I see the full file path in compiler errors?

$
0
0

I have a CMake project that I compile with gcc on Linux. Because of how CMake invokes gcc in subdirectories, gcc outputs only the base file name when it encounters an error:

[100%] Building C object path/file.c.o
cd /absolute/path && /usr/bin/cc [...]
file.c: In function ‘foo’:
file.c:85:5: error: unknown type name ‘bar’

How can I see the full file path in the gcc output? Any solution through either CMake or gcc configuration would be acceptable. I want to see something like this:

/absolute/path/file.c:85:5: error: unknown type name ‘bar’

or

path/file.c:85:5: error: unknown type name ‘bar’

(preferrably the former).


Viewing all articles
Browse latest Browse all 22113

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>