ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1

Hi, I'm facing the same error! You example is Passed! But it doesn't work when I compile NCURSES. It seems that there are something wrong with my ld

% ld -v
@(#)PROGRAM:ld  PROJECT:ld64-711
BUILD 18:11:19 Aug  3 2021
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
LTO support using: LLVM version 13.0.0, (clang-1300.0.29.3) (static support for 27, runtime is 27)
TAPI support using: Apple TAPI version 13.0.0 (tapi-1300.0.6.5)
% clang -v
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Here are the configuration and error.

** Configuration summary for NCURSES 6.3 20211021:
       extended funcs: yes
       xterm terminfo: xterm-new
        bin directory: /usr/local/bin
        lib directory: /usr/local/lib
    include directory: /usr/local/include/ncurses
        man directory: /usr/local/share/man
   terminfo directory: /usr/local/share/terminfo
** Include-directory is not in a standard location```

gcc ../objects/tic.o ../objects/dump_entry.o ../objects/tparm_type.o ../objects/transform.o -L../lib -Wl,-search_paths_first -DHAVE_CONFIG_H -I../progs -I. -I../include -D_DARWIN_C_SOURCE -DNDEBUG -O2 -Qunused-arguments -Wno-error=implicit-function-declaration -no-cpp-precomp  -DNCURSES_STATIC -L../lib  -lncurses -lncurses    -o tic

ld: warning: ignoring file ../lib/libncurses.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 ) Undefined symbols for architecture arm64:   "__nc_boolcodes", referenced from:       _nametrans in dump_entry.o       _dump_init in dump_entry.o   "__nc_boolfnames", referenced from:       _dump_init in dump_entry.o   "__nc_boolnames", referenced from:       _dump_init in dump_entry.o   "__nc_capcmp", referenced from:       _check_termtype in tic.o       _check_sgr in tic.o   "__nc_check_termtype2", referenced from:       _main in tic.o   "__nc_curr_col", referenced from:       _main in tic.o   "__nc_curr_line", referenced from:       _main in tic.o   "__nc_disable_period", referenced from:       _main in tic.o   "__nc_doalloc", referenced from:       _main in tic.o       _fmt_entry in dump_entry.o       _strcpy_DYN in dump_entry.o       _fmt_complex in dump_entry.o       _strncpy_DYN in dump_entry.o   "__nc_find_entry", referenced from:       _check_user_capability_type in tic.o       _nametrans in dump_entry.o   "__nc_find_user_entry", referenced from:       _check_termtype in tic.o       _check_user_capability_type in tic.o   "__nc_first_name", referenced from:       _main in tic.o       _check_termtype in tic.o       _fmt_complex in dump_entry.o       _dump_entry in dump_entry.o   "__nc_get_hash_table", referenced from:       _check_user_capability_type in tic.o       _nametrans in dump_entry.o   "__nc_head", referenced from:       _main in tic.o   "__nc_home_terminfo", referenced from:       _show_databases in tic.o   "__nc_infotocap", referenced from:       _check_termtype in tic.o       _fmt_entry in dump_entry.o   "__nc_name_match", referenced from:       _main in tic.o   "__nc_numcodes", referenced from:       _nametrans in dump_entry.o       _dump_init in dump_entry.o   "__nc_numfnames", referenced from:       _dump_init in dump_entry.o   "__nc_numnames", referenced from:       _dump_init in dump_entry.o   "__nc_pathlast", referenced from:       _valid_db_path in tic.o   "__nc_read_entry_source", referenced from:       _main in tic.o   "__nc_reset_tparm", referenced from:       _check_termtype in tic.o       _check_1_infotocap in tic.o   "__nc_resolve_uses2", referenced from:       _main in tic.o   "__nc_rootname", referenced from:       _main in tic.o   "__nc_set_source", referenced from:       _main in tic.o   "__nc_set_type", referenced from:       _main in tic.o   "__nc_set_writedir", referenced from:       _main in tic.o   "__nc_strcodes", referenced from:       _nametrans in dump_entry.o       _dump_init in dump_entry.o   "__nc_strfnames", referenced from:       _dump_init in dump_entry.o   "__nc_strict_bsd", referenced from:       _main in tic.o   "__nc_strnames", referenced from:       _check_termtype in tic.o      _dump_init in dump_entry.o       _dump_entry in dump_entry.o   "__nc_syntax", referenced from:       _check_termtype in tic.o   "__nc_tail", referenced from:       _main in tic.o   "__nc_tic_dir", referenced from:   _main in tic.o       _show_databases in tic.o   "__nc_tic_expand", referenced from:       _check_ansi_cursor in tic.o       _fmt_entry in dump_entry.o   "__nc_tic_written", referenced from:       _main in tic.o   "__nc_tinfo_fkeysf", referenced from:       _check_termtype in tic.o   "__nc_tiparm", referenced from:       _check_termtype in tic.o       _check_sgr in tic.o       _check_1_infotocap in tic.o       _same_color in tic.o   "__nc_tparm_analyze", referenced from:       _check_termtype in tic.o       _check_1_infotocap in tic.o   "__nc_tparm_err", referenced from:       _check_termtype in tic.o       _check_sgr in tic.o   "__nc_tracing", referenced from:       _main in tic.o   "__nc_trim_sgr0", referenced from:       _check_termtype in tic.o       _fmt_entry in dump_entry.o   "__nc_user_definable", referenced from:       _check_termtype in tic.o       _fmt_entry in dump_entry.o       _compare_entry in dump_entry.o   "__nc_visbuf", referenced from:       _similar_sgr in tic.o   "__nc_visbuf2", referenced from:       _check_termtype in tic.o       _check_sgr in tic.o       _similar_sgr in tic.o   "__nc_warning", referenced from:       _check_termtype in tic.o       _check_user_capability_type in tic.o       _check_sgr in tic.o       _check_sgr_param in tic.o       _check_1_infotocap in tic.o       _check_noaddress in tic.o       _check_ansi_cursor in tic.o       ...   "__nc_write_entry", referenced from:       _main in tic.o   "__nc_write_object", referenced from:       _dump_entry in dump_entry.o   "_curses_version", referenced from:       _main in tic.o   "_keyname", referenced from:       _check_termtype in tic.o   "_tgoto", referenced from:       _check_sgr_param in tic.o   "_tigetflag", referenced from:       _check_termtype in tic.o   "_tigetstr", referenced from:       _check_termtype in tic.o   "_tparm", referenced from:       _check_termtype in tic.o       _check_1_infotocap in tic.o      (maybe you meant: _tparm_type, _guess_tparm_type )   "_use_extended_names", referenced from:       _main in tic.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [tic] Error 1 make: *** [all] Error 2

ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1
 
 
Q