So after too many hours finally it's been solved. It goes like this:

  1. Download libdwarf-20130207.tar.gz
  2. Extract the archive and in a new terminal type:

    cd dwarf-2013-02-07/libdwarf
    ./configure --enable-shared
    make -j$(nproc)
    
  3. If you need a 32 bit library (as in my case), just open the MakeFile and add -m32 to CFLAGS

    CFLAGS = -m32 $(PREINCS) -g -O2 $(INCLUDES) $(dwfpic) $(POSTINCS)
    
  4. At the end, just copy the libdwarf.so into /usr/lib

Answer from Petter Bjao on askubuntu.com
🌐
GitHub
github.com › acmel › dwarves › blob › master › cmake › modules › FindDWARF.cmake
dwarves/cmake/modules/FindDWARF.cmake at master · acmel/dwarves
if (NOT DWARF_INCLUDE_DIR) message(STATUS "Could NOT find dwarf include dir") endif (NOT DWARF_INCLUDE_DIR) if (NOT LIBDW_INCLUDE_DIR) message(STATUS "Could NOT find libdw include dir") endif (NOT LIBDW_INCLUDE_DIR) if (NOT DWARF_LIBRARY) message(STATUS "Could NOT find libdw library") endif (NOT DWARF_LIBRARY) if (NOT ELF_LIBRARY) message(STATUS "Could NOT find libelf library") endif (NOT ELF_LIBRARY) endif (FEDORA OR REDHAT) message(FATAL_ERROR "Could NOT find some ELF and DWARF libraries, please install the missing packages") endif (DWARF_FIND_REQUIRED) endif (DWARF_FOUND) ·
Author   acmel
🌐
GitHub
github.com › SimonKagstrom › kcov › issues › 22
cmake error:Could NOT find LibDwarf (missing: LIBDWARF_LIBRARIES LIBDWARF_INCLUDE_DIRS) · Issue #22 · SimonKagstrom/kcov
July 18, 2014 - already install libbdwraft , however ,when I run cmake, always alert: Could NOT find LibDwarf (missing: LIBDWARF_LIBRARIES LIBDWARF_INCLUDE_DIRS) ls /usr/local/lib/libdwarf.* /usr/local/lib/libdwarf.a /usr/local/lib/libdwarf.h cmake '-DC...
Author   SimonKagstrom
🌐
The Mail Archive
mail-archive.com › openwrt-devel@lists.openwrt.org › msg61620.html
Re: [PATCH 2/6] tools/dwarves: add host package
February 28, 2022 - > > BTW this fails to build if libdw-dev is not installed with > > > > -- Checking availability of DWARF and ELF development libraries > > -- Could NOT find dwarf include dir > > -- Could NOT find libdw include dir > > -- Could NOT find libdw library > > CMake Error at cmake/modules/FindDWARF.cmake:93 (message): > > Could NOT find some ELF and DWARF libraries, please install the missing > > packages > > Call Stack (most recent call first): > > CMakeLists.txt:60 (find_package) > > > > ERROR: tools/dwarves failed to build.
🌐
GitHub
github.com › apitrace › apitrace › issues › 519
Does not detect libdwarf · Issue #519 · apitrace/apitrace
April 25, 2017 - include (CheckIncludeFile) check_include_file (dwarf.h HAVE_DWARF_H) check_include_file (libdwarf/dwarf.h HAVE_LIBDWARF_DWARF_H) get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) foreach(dir ${dirs}) message(STATUS "dir='${dir}'") endforeach() if (NOT HAVE_DWARF_H AND NOT HAVE_LIBDWARF_DWARF_H) set (FORMAT_FILE unknown.c) set (BACKTRACE_SUPPORTED 0) message (STATUS "libdwarf not found.
Author   apitrace
🌐
GitHub
github.com › VIS4ROB-lab › fast_multi_robot_exploration › issues › 4
dwarf.h is not found: "dwarf.h: No such file or directory" · Issue #4 · VIS4ROB-lab/fast_multi_robot_exploration
November 19, 2024 - Hi, When I catkin_make this project, I meet dwarf.h not found issue as below, could you help to find out the solution? Thanks in advance! /home/xiaohua/Desktop/project/fmre/catkin_ws/src/fast_multi_robot_exploration/swarm_exploration/plan_manage/include/plan_manage/backward.hpp:217:10: fatal error: dwarf.h: No such file or directory 217 | #include <dwarf.h> | ^~~~~~~~~ compilation terminated.
Author   VIS4ROB-lab
🌐
Narkive
apitrace.freedesktop.narkive.com › gp7t7c1j › libdwarf-not-found
libdwarf not found
Permalink Hi, What if you try "apt search dwarf", does that find libdwarf for you? apt search will list all possible packages with "dwarf" in their name. From list you need to choose correct one to install, you can get more info on each package with "apt show <package name>" /Juha-Pekka · Post by Jiachen Song Thank you very much for your reply. I did try "sudo apt-get install libdwarf-dev"but "libdwarf not found. Disabling Backtrace support." does't disappear. and in and only in file apitrace/thirdparty/libbacktrace/CMakeLists.txt, " include (CheckIncludeFile) check_include_file (dwarf.h HAVE_DWARF_H) check_include_file (libdwarf/dwarf.h HAVE_LIBDWARF_DWARF_H) if (NOT HAVE_DWARF_H AND NOT HAVE_LIBDWARF_DWARF_H) set (FORMAT_FILE unknown.c) set (BACKTRACE_SUPPORTED 0) message (STATUS "libdwarf not found.
🌐
GitHub
github.com › pmachata › dwgrep › blob › master › cmake › modules › FindDWARF.cmake
dwgrep/cmake/modules/FindDWARF.cmake at master · pmachata/dwgrep
if (NOT DWARF_INCLUDE_DIR) message(STATUS "Could NOT find dwarf include dir") endif (NOT DWARF_INCLUDE_DIR) if (NOT ELF_INCLUDE_DIR) message(STATUS "Could NOT find elf include dir") endif (NOT ELF_INCLUDE_DIR) if (NOT LIBDW_INCLUDE_DIR) message(STATUS "Could NOT find libdw include dir") endif (NOT LIBDW_INCLUDE_DIR) if (NOT DWARF_LIBRARY) message(STATUS "Could NOT find libdw library") endif (NOT DWARF_LIBRARY) if (NOT ELF_LIBRARY) message(STATUS "Could NOT find libelf library") endif (NOT ELF_LIBRARY) endif (FEDORA OR REDHAT) message(FATAL_ERROR "Could NOT find some ELF and DWARF libraries, please install the missing packages") endif (DWARF_FIND_REQUIRED) endif (DWARF_FOUND) ·
Author   pmachata
Find elsewhere
🌐
Google Source
kernel.googlesource.com › pub › scm › devel › pahole › pahole › + › v1.5 › cmake › modules › FindDWARF.cmake
cmake/modules/FindDWARF.cmake - pub/scm/devel/pahole/pahole - Git at Google
Sign in · kernel / pub / scm / devel / pahole / pahole / v1.5 / . / cmake / modules / FindDWARF.cmake · blob: c72026c4dee30e80bad15733cce7b205e5b435ad [file] [log] [blame] · Powered by Gitiles| Privacy| Termstxt json
🌐
Debian
bugs.debian.org › cgi-bin › bugreport.cgi
#965247 - ld: DWARF error: could not find variable specification at offset - Debian Bug report logs
July 18, 2020 - -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Hi Norbert, I had a similar issue with binutils 2.34.90. Turned out I had to include a file with "C" linking extern "C" { #include "include_filename.h" } This solved the DWARF errors. Hope this help.
🌐
GitHub
github.com › flatpak › flatpak › issues › 254
compiling flatpak on ubuntu fails due to dwarf.h weirdness · Issue #254 · flatpak/flatpak
August 18, 2016 - $ locate dwarf /usr/share/qt4/mkspecs/features/mac/dwarf2.prf /usr/share/qt4/mkspecs/features/unix/gdb_dwarf_index.prf /usr/src/linux-headers-4.4.0-30/arch/sh/include/asm/dwarf.h /usr/src/linux-headers-4.4.0-30/arch/x86/include/asm/dwarf2.h /usr/src/linux-headers-4.4.0-31/arch/sh/include/asm/dwarf.h /usr/src/linux-headers-4.4.0-31/arch/x86/include/asm/dwarf2.h /usr/src/linux-headers-4.4.0-32/arch/sh/include/asm/dwarf.h /usr/src/linux-headers-4.4.0-32/arch/x86/include/asm/dwarf2.h /usr/src/linux-headers-4.4.0-34/arch/sh/include/asm/dwarf.h /usr/src/linux-headers-4.4.0-34/arch/x86/include/asm/dw
Author   flatpak
🌐
FreeDesktop
bugs.freedesktop.org › show_bug.cgi
94308 – 0.4.13 fails to build because of missing dwarf.h
February 26, 2016 - Bugzilla – Bug 94308 0.4.13 fails to build because of missing dwarf.h Last modified: 2016-02-26 14:06:00 UTC ... Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.
🌐
Prevanders
prevanders.net › dwarfwip.html
DWARF Work in Progress
A big thank you to qubka for notifying us. Removed (for builds on Windows) unwanted instances defining off_t in libdwarf_private.h . Now we include sys/types.h to get an off_t definition. Coverity scan finds one 'potential overflow' in calculations related to using mmap for data sections. ... Revised code for DWARF6 attributes DW_AT_language_name and DW_AT_language_version to be correct so all the data can be accessed.
🌐
Spinics.net
spinics.net › lists › dwarves › msg00055.html
Fwd: Bug#534529: libdw-dev: missing libebl makes dwarves fail to build — Linux DWARVES
June 25, 2009 - If you agree that this should be fixed in dwarves, I have a change viewable at http://repo.or.cz/w/dwarves/SamB.git?a=commitdiff;h=65d658b86413d10ffbb4a83a917af090d42df310which can be pulled from git://repo.or.cz/dwarves/SamB.git master which allows the configuration process to continue even if libebl is not found, on the assumption that the check_library_exists call will sort things out...
🌐
Ask Ubuntu
askubuntu.com › questions › 325928 › while-running-dwarf-fortress-command-line-gives-me-some-error-about-file-not-fo
games - While running Dwarf Fortress, command line gives me some error about file not found - Ask Ubuntu
~/Downloads/df_linux/libs$ cd ~/bin ~/bin$ ls -la total 14788 -rwxr--r-- 1 ***** ***** 243 Jul 29 14:06 df -rwx------ 1 ***** ***** 15104448 Jun 29 14:06 Dwarf_Fortress ~/bin$ df /home/*****/bin/df: 6: /home/*****/bin/df: ./libs/Dwarf_Fortress: not found ~/bin$ Dwarf_Fortress bash: /home/*****/bin/Dwarf_Fortress: No such file or directory ~/bin$ Again, the same problem. something is wrong with this · Anyways, if you have been wondering, I ran touch * on the files, and didn't include all stuff in my ~/bin, and export PS1='/w$ ' in my .bashrc ... Since it tells me that it can't find the exeutable, I edited the last line form ./libs/Dwarf_Fortress to the full path, same error.
🌐
GitHub
github.com › conan-io › conan-center-index › issues › 16799
[package] backward-cpp/1.6: Build fails on Linux with `dwarf.h: No such file or directory` · Issue #16799 · conan-io/conan-center-index
March 30, 2023 - Description backward-cpp cannot be built or consumed on Linux with default stack_details option value (dwarf) if libdw is not installed on the system (in conancenter, it lives in elfutils recipe). It's similar to #16787, but this issue i...
Author   conan-io
🌐
Dwarfstd
dwarfstd.org › ShowIssue.php
DWARF Issue: Clarify recommendations for filenames
In Section 7.5.4, "Attribute Encodings," on page 138, add the following row to Figure 20: Attribute name Value Classes -------------- ----- ------- DW_AT_host 0x?? string (Assign the next available attribute value, which would be 0x69 based on the latest draft of the DWARF-3 specification.) (B) In Section 6.2.4, "The Line Number Program Header," item 10, "include_directories", on page 97, replace this sentence: Each entry is a null-terminated string containing a full path name.
🌐
Ubuntu
packages.ubuntu.com › search
Ubuntu – Package Contents Search Results -- dwarf.h
You have searched for files named dwarf.h in suite xenial, all sections, and all architectures.