Fix compile error: “fatal error: ‘libelf.h’ file not found”

Recently, when I try to build an open source project, I meet the following compile error:

fatal error: 'libelf.h' file not found
#include <libelf.h>
     ^
1 error generated.

The solution is installing elfutils-libelf-devel package:

sudo yum install elfutils-libelf-devel

Or:

sudo dnf install elfutils-libelf-devel

(You can also read this post on itechlounge.net)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.