Skip to content

Build error "‘bfd_get_section_flags’ was not declared in this scope" #93

Closed
@erksch

Description

@erksch

Hey there.

I tried to build aws-lambda-cpp on my Ubuntu 20.4 machine but got the following errors:

In file included from /home/erik/Projects/tuk/aws-lambda-cpp/src/backward.cpp:26:0:
/home/erik/Projects/tuk/aws-lambda-cpp/src/backward.h: In member function ‘void backward::TraceResolverLinuxImpl<backward::trace_resolver_tag::libbfd>::find_in_section(bfd_vma, bfd_vma, backward::TraceResolverLinuxImpl<backward::trace_resolver_tag::libbfd>::bfd_fileobject&, asection*, backward::TraceResolverLinuxImpl<backward::trace_resolver_tag::libbfd>::find_sym_result&)’:
/home/erik/Projects/tuk/aws-lambda-cpp/src/backward.h:1235:14: error: ‘bfd_get_section_flags’ was not declared in this scope
         if ((bfd_get_section_flags(fobj.handle.get(), section) & SEC_ALLOC) == 0)
              ^~~~~~~~~~~~~~~~~~~~~
/home/erik/Projects/tuk/aws-lambda-cpp/src/backward.h:1235:14: note: suggested alternative: ‘bfd_set_section_flags’
         if ((bfd_get_section_flags(fobj.handle.get(), section) & SEC_ALLOC) == 0)
              ^~~~~~~~~~~~~~~~~~~~~
              bfd_set_section_flags
/home/erik/Projects/tuk/aws-lambda-cpp/src/backward.h:1238:28: error: ‘bfd_get_section_vma’ was not declared in this scope
         bfd_vma sec_addr = bfd_get_section_vma(fobj.handle.get(), section);
                            ^~~~~~~~~~~~~~~~~~~
/home/erik/Projects/tuk/aws-lambda-cpp/src/backward.h:1238:28: note: suggested alternative: ‘bfd_set_section_vma’
         bfd_vma sec_addr = bfd_get_section_vma(fobj.handle.get(), section);
                            ^~~~~~~~~~~~~~~~~~~
                            bfd_set_section_vma
/home/erik/Projects/tuk/aws-lambda-cpp/src/backward.h:1239:30: error: ‘bfd_get_section_size’ was not declared in this scope
         bfd_size_type size = bfd_get_section_size(section);
                              ^~~~~~~~~~~~~~~~~~~~
/home/erik/Projects/tuk/aws-lambda-cpp/src/backward.h:1239:30: note: suggested alternative: ‘bfd_set_section_size’
         bfd_size_type size = bfd_get_section_size(section);
                              ^~~~~~~~~~~~~~~~~~~~
                              bfd_set_section_size
make[2]: *** [CMakeFiles/aws-lambda-runtime.dir/build.make:89: CMakeFiles/aws-lambda-runtime.dir/src/backward.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/aws-lambda-runtime.dir/all] Fehler 2
make: *** [Makefile:130: all] Fehler 2

CMake: 3.16.3
GCC: 9.3.0
Distro: Ubuntu 20.4.

As far as I can tell, libbfd exists:

$ locate libbfd
/snap/gnome-3-34-1804/24/usr/lib/x86_64-linux-gnu/libbfd-2.30-system.so
/snap/gnome-3-34-1804/33/usr/lib/x86_64-linux-gnu/libbfd-2.30-system.so
/usr/lib/x86_64-linux-gnu/libbfd-2.34-system.so
/usr/lib/x86_64-linux-gnu/libbfd.a
/usr/lib/x86_64-linux-gnu/libbfd.so

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions