I am new to Linux programming and am trying to use the BFD library. This is the current code I'm trying to compile:
#include <bfd.h> #include <stdlib.h> bfd *abfd; int main() { bfd_init(); abfd = bfd_openr("/home/mike/Desktop/testFunc/testProg", NULL); return 0; }
I use the following command line to compile:
gcc readInfo.c /usr/lib/libbfd.a -o readInfo
And I get the following errors:
gcc readInfo.c / usr / lib / libbfd.a -o readInfo /usr/lib/libbfd.a(elflink.o): function elf_link_add_object_symbols': /build/buildd/binutils-2.21.53.20110810/builddir-single/bfd/../../bfd/elflink.c:4605: undefined reference to objalloc_free_block "/ build / buildd / binutils -2.21.53.20110810 / builddir-single / bfd /../../ bfd / elflink.c: 4892: undefined link to _sch_istable' /usr/lib/libbfd.a(elflink.o): In function bfd_elf_size_dynamic_sections': / build / buildd / binutils -2.21.53.20110810 / builddir-single / bfd /../../ bfd / elflink .c: 6048: undefined link to lbasename' undefined reference to _sch_istable' collect2: ld returned 1 output status make: * [all] Error 1
There are many more error lines here that you can view here here . I am sure there is a simple explanation for this, but for a while I am a little puzzled.
To summarize what I have done so far:
- Ubuntu Clean Build Installed
- Installed binutils-dev package
source share