> On Aug 15, 2019, at 1:02 PM, Pascal <p....@orange.fr> wrote:
>
> Hello,
>
> I've got linker errors with my program which use ncurses.
> Previously it link against librairies in /usr/lib from Apple developper tools.
> But since Command Line Tools (HS 10.13), I got:
> Undefined symbols for architecture x86_64:
> "_current_item", referenced from:
> _terminal_interface__curses__menus__current in
> terminal_interface-curses-menus.o
> "_free_item", referenced from:
> _terminal_interface__curses__menus__delete in
> terminal_interface-curses-menus.o
> terminal_interface__curses__menus(float, long double,...)(...) in
> terminal_interface-curses-menus.o
> "_free_menu", referenced from:
> _terminal_interface__curses__menus__delete__2 in
> terminal_interface-curses-menus.o
> <...>
> "_top_row", referenced from:
> _terminal_interface__curses__menus__top_row in
> terminal_interface-curses-menus.o
> (maybe you meant: _terminal_interface__curses__menus__top_row,
> _terminal_interface__curses__menus__set_top_row )
> "_unpost_menu", referenced from:
> _terminal_interface__curses__menus__post in
> terminal_interface-curses-menus.o
> ld: symbol(s) not found for architecture x86_64
> collect2: error: ld returned 1 exit status
>
> Like the lib menu is not seen for x86_64, but it seems to be ok:
>
> $ otool -vf /usr/lib/libmenu.dylib
> Fat headers
> fat_magic FAT_MAGIC
> nfat_arch 2
> architecture x86_64
> cputype CPU_TYPE_X86_64
> cpusubtype CPU_SUBTYPE_X86_64_ALL
> capabilities 0x0
> offset 4096
> size 36064
> align 2^12 (4096)
> architecture i386
> cputype CPU_TYPE_I386
> cpusubtype CPU_SUBTYPE_I386_ALL
> capabilities 0x0
> offset 40960
> size 35488
> align 2^12 (4096)
>
> It's really a pity that some libraries coming from Apple fail :-(
> I was advised to build the library from source
> https://invisible-island.net/ncurses.
> Though it is available with other building systems, I aim to get it via
> gtk-osx.
> What is the best way to add it?
Pascal,
It's strange enough that something is still using curses in 2019, but stranger
still that it uses curses and Gtk.
Anyway, the direct answer to your question is to just add it to your local
module set just like any other library that you need.
But first make sure that the symbols really are missing, they're present in
10.14:
$ Manjusri:/Users/john> nm /usr/lib/libmenu.5.4.dylib | grep _unpost_menu
000000000000379a T _unpost_menu
$ Manjusri:/Users/john> nm /usr/lib/libmenu.5.4.dylib | grep _current_item
00000000000024cd T _current_item
000000000000240d T _set_current_item
$ Manjusri:/Users/john> nm /usr/lib/libmenu.5.4.dylib | grep _free_item
000000000000269c T _free_item
$ Manjusri:/Users/john> nm /usr/lib/libmenu.5.4.dylib | grep _free_menu
0000000000002c2a T _free_menu
$ Manjusri:/Users/john> nm /usr/lib/libmenu.5.4.dylib | grep _top_row
0000000000002913 T _set_top_row
00000000000029da T _top_row
It's libncurses 5.4 released in 2004, meaning that Apple has probably not
changed it since MacOS X 10.2 or so. ISTM it's more likely that you've got the
wrong link order than that libmenu is missing all of its symbols.
Regards,
John Ralls
_______________________________________________
gtk-osx-users-list mailing list
gtk-osx-users-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-osx-users-list