LINUX.ORG.RU

NCURSES и статическая линковка


0

0

Не компилится ncurses татически.

$g++ akv.c conf_api.cpp libdscud5.a modb_ms.cpp -o akv_last -lpthread -lncurses -static

/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libncurses.a(lib_mouse.o): In function `_nc_mouse_init':
(.text+0x833): undefined reference to `dlopen'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libncurses.a(lib_mouse.o): In function `_nc_mouse_init':
(.text+0x84d): undefined reference to `dlsym'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libncurses.a(lib_mouse.o): In function `_nc_mouse_init':
(.text+0x866): undefined reference to `dlsym'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libncurses.a(lib_mouse.o): In function `_nc_mouse_init':
(.text+0x87f): undefined reference to `dlsym'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libncurses.a(lib_mouse.o): In function `_nc_mouse_init':
(.text+0x898): undefined reference to `dlsym'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../libncurses.a(lib_mouse.o): In function `_nc_mouse_init':
(.text+0x8b5): undefined reference to `dlclose'

Если убрать -static, то всё собирается без проблем. Кто сталкивался с таким?

Ответ на: комментарий от golodranez

прекрасно знают

-l<library>

-ldl

в частности будет прилинковывать libdl.a (libdl.so)
в которой те самые `missing symbols` и находятся

Sylvia ★★★★★
()
Ответ на: комментарий от Sylvia

>прекрасно знают

яж говорю, ступил просто:) всё собирается, спасибо.

golodranez ★★★★
() автор топика
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.