#17 Static linking with pkg-config does not work out of the box
Closed: Fixed 2 years ago by mlichvar. Opened 2 years ago by asheplyakov.

gcc -o test_static test.c `pkg-config --libs --cflags --static libnewt`
  /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libnewt.a(form.o): in function `Gpm_Open.part.0.constprop.0':
    (.text+0x38c): warning: the use of `tempnam' is dangerous, better use `mkstemp'
    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libnewt.a(newt.o): in function `wchar_to_textmod_visual.constprop.0':
    (.text+0xa53): undefined reference to `dlerror'
    /usr/bin/ld: (.text+0xa72): undefined reference to `dlsym'
    /usr/bin/ld: (.text+0xe55): undefined reference to `dlopen'
    /usr/bin/ld: (.text+0xe6d): undefined reference to `dlerror'
    /usr/bin/ld: (.text+0xe7e): undefined reference to `dlopen'
    /usr/bin/ld: (.text+0xe96): undefined reference to `dlerror'
    /usr/bin/ld: (.text+0xf83): undefined reference to `dlclose'
    /usr/bin/ld: (.text+0xfa5): undefined reference to `dlerror'
    /usr/bin/ld: (.text+0xfe1): undefined reference to `dlclose'
    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libnewt.a(newt.o): in function `write_string_int':
    (.text+0x1267): undefined reference to `SLsmg_write_string'
    /usr/bin/ld: (.text+0x12ae): undefined reference to `SLsmg_write_string'
    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libnewt.a(newt.o): in function `write_nstring_int':
    (.text+0x1398): undefined reference to `SLsmg_write_nstring'
    /usr/bin/ld: (.text+0x13e7): undefined reference to `SLsmg_write_nstring'
    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libnewt.a(newt.o): in function `newtFlushInput':
    (.text+0x1523): undefined reference to `SLang_input_pending'
    /usr/bin/ld: (.text+0x1531): undefined reference to `SLang_getkey'
    /usr/bin/ld: (.text+0x153c): undefined reference to `SLtt_Screen_Rows'
    /usr/bin/ld: (.text+0x1543): undefined reference to `SLsmg_touch_lines'
    /usr/bin/ld: (.text+0x1548): undefined reference to `SLsmg_refresh'

[skipped 200+ undefined reference errors]


Metadata Update from @mlichvar:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

2 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #18 Closed 2 years ago