I'm trying to compile an example stack trace displaying code. When I compile the test.c
file with:
gcc -g -rdynamic ./test.c -o test
I get following error:
./test.c: In function ‘handler’:
./test.c:16: error: ‘STDERR_FILENO’ undeclared (first use in this function)
./test.c:16: error: (Each undeclared identifier is reported only once
./test.c:16: error: for each function it appears in.)
My includes are the same as in the original post code:
#include <stdio.h>
#include <execinfo.h>
#include <signal.h>
#include <stdlib.h>
My machine is ubuntu 13.04. Am I missing some library or haven't included something?
Also #include <unistd.h>
.
See this GNU documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With