неопределенная ссылка на * с использованием g 9.3.0

#g #undefined-reference #raft

Вопрос:

Прежде всего, спасибо, что уделили мне время.
Я довольно долго искал эту ошибку здесь и там, но, похоже, не могу найти ее причину.
(Я совершенно уверен, что это нечто очевидное, что я просто не учел)

Итак, у меня есть эта библиотека : libraft.so, в котором есть экспортированные символы :

     root@chuck-VirtualBox:/# nm -D /usr/local/lib/libraft.so
                 (...)
0000000000006810 T raft_add
0000000000009710 T raft_aligned_alloc
0000000000009730 T raft_aligned_free
0000000000006460 T raft_apply
0000000000006950 T raft_assign
0000000000006660 T raft_barrier
000000000000b730 T raft_bootstrap
00000000000096d0 T raft_calloc
000000000000b650 T raft_close
000000000000baf0 T raft_configuration_add
000000000000ba90 T raft_configuration_close
000000000000bb00 T raft_configuration_encode
000000000000b7a0 T raft_configuration_init
000000000000bb10 T raft_digest
000000000000b720 T raft_errmsg
0000000000013460 T raft_fixture_add_entry
0000000000012570 T raft_fixture_alive
00000000000123a0 T raft_fixture_bootstrap
0000000000012120 T raft_fixture_close
0000000000012270 T raft_fixture_configuration
0000000000012f90 T raft_fixture_depose
00000000000131e0 T raft_fixture_desaturate
00000000000125e0 T raft_fixture_disconnect
0000000000012ed0 T raft_fixture_elect
0000000000012380 T raft_fixture_get
00000000000132b0 T raft_fixture_grow
00000000000125d0 T raft_fixture_hook
0000000000012010 T raft_fixture_init
00000000000134d0 T raft_fixture_io_fault
0000000000013250 T raft_fixture_kill
0000000000012590 T raft_fixture_leader_index
0000000000012360 T raft_fixture_n
0000000000013520 T raft_fixture_n_recv
0000000000013500 T raft_fixture_n_send
0000000000012650 T raft_fixture_reconnect
00000000000126c0 T raft_fixture_saturate
0000000000012730 T raft_fixture_saturated
0000000000013400 T raft_fixture_set_disk_latency
00000000000133e0 T raft_fixture_set_network_latency
00000000000133c0 T raft_fixture_set_randomized_election_timeout
0000000000013440 T raft_fixture_set_snapshot
0000000000013420 T raft_fixture_set_term
0000000000012300 T raft_fixture_start
00000000000127a0 T raft_fixture_step
0000000000012df0 T raft_fixture_step_n
0000000000012e30 T raft_fixture_step_until
0000000000013050 T raft_fixture_step_until_applied
0000000000013190 T raft_fixture_step_until_delivered
0000000000012e90 T raft_fixture_step_until_elapsed
0000000000012eb0 T raft_fixture_step_until_has_leader
0000000000012f70 T raft_fixture_step_until_has_no_leader
00000000000130a0 T raft_fixture_step_until_state_is
00000000000130f0 T raft_fixture_step_until_term_is
0000000000013140 T raft_fixture_step_until_voted_for
0000000000012370 T raft_fixture_time
00000000000125b0 T raft_fixture_voted_for
00000000000096a0 T raft_free
0000000000009750 T raft_heap_set
0000000000009760 T raft_heap_set_default
000000000000b7b0 T raft_init
0000000000010b60 T raft_last_applied
0000000000010b50 T raft_last_index
0000000000010ae0 T raft_leader
0000000000009680 T raft_malloc
00000000000096f0 T raft_realloc
000000000000b760 T raft_recover
0000000000006ce0 T raft_remove
000000000000b6a0 T raft_set_election_timeout
000000000000b6b0 T raft_set_heartbeat_timeout
000000000000b6c0 T raft_set_install_snapshot_timeout
000000000000b700 T raft_set_max_catch_up_round_duration
000000000000b6f0 T raft_set_max_catch_up_rounds
000000000000b710 T raft_set_pre_vote
000000000000b6d0 T raft_set_snapshot_threshold
000000000000b6e0 T raft_set_snapshot_trailing
0000000000010350 T raft_start
0000000000010ad0 T raft_state
000000000000b790 T raft_strerror
0000000000006e30 T raft_transfer
0000000000014910 T raft_uv_close
0000000000014540 T raft_uv_init
0000000000014930 T raft_uv_set_block_size
0000000000014960 T raft_uv_set_connect_retry_delay
0000000000014920 T raft_uv_set_segment_size
0000000000014940 T raft_uv_set_snapshot_compression
0000000000014970 T raft_uv_set_tracer
000000000001e7f0 T raft_uv_tcp_close
000000000001e6a0 T raft_uv_tcp_init
                 U rand
                 U read
                 U realloc
                 U snprintf
                 U __snprintf_chk
                 U __sprintf_chk
                 U srand
                 U __stack_chk_fail
                 U stderr
                 U __strcat_chk
                 U strcmp
                 U strcpy
                 U __strcpy_chk
                 U strlen
                 U strnlen
                 U strtok
                 U strtol
                 U syscall
                 U uv_accept
                 U uv_check_init
                 U uv_check_start
                 U uv_close
                 U uv_fs_close
                 U uv_fs_fdatasync
                 U uv_fs_fsync
                 U uv_fs_ftruncate
                 U uv_fs_open
                 U uv_fs_rename
                 U uv_fs_scandir
                 U uv_fs_scandir_next
                 U uv_fs_stat
                 U uv_fs_unlink
                 U uv_fs_write
                 U uv_ip4_addr
                 U uv_listen
                 U uv_now
                 U uv_poll_init
                 U uv_poll_start
                 U uv_poll_stop
                 U uv_queue_work
                 U uv_read_start
                 U uv_read_stop
                 U uv_strerror
                 U uv_tcp_bind
                 U uv_tcp_connect
                 U uv_tcp_init
                 U uv_timer_init
                 U uv_timer_start
                 U uv_timer_stop
                 U uv_write
                 U write
 

Однако, когда я пытаюсь скомпилировать, используя следующую команду :

 g   --std=c  2a -O3 -Wall *.cpp -o a.out `pkg-config --cflags --libs raft libuv` 
 

(что переводится как )

 g   --std=c  2a -O3 -Wall *.cpp -o a.out -I/usr/local/include -L/usr/local/lib -lraft -luv -lrt -lpthread -lnsl -ldl
 

У меня все еще есть много неопределенных ссылок :

 /usr/bin/ld: /tmp/ccUm3H2p.o: in function `ClServer::UnInit(void (*)(ClServer*))':
ClServer.cpp:(.text 0x32): undefined reference to `raft_close(raft*, void (*)(raft*))'
/usr/bin/ld: /tmp/ccUm3H2p.o: in function `ClServer::Init(uv_loop_s*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)':
ClServer.cpp:(.text 0xea): undefined reference to `raft_uv_tcp_init(raft_uv_transport*, uv_loop_s*)'
/usr/bin/ld: ClServer.cpp:(.text 0x110): undefined reference to `raft_uv_init(raft_io*, uv_loop_s*, char const*, raft_uv_transport*)'
/usr/bin/ld: ClServer.cpp:(.text 0x122): undefined reference to `raft_malloc(unsigned long)'
/usr/bin/ld: ClServer.cpp:(.text 0x1b1): undefined reference to `raft_init(raft*, raft_io*, raft_fsm*, unsigned long long, char const*)'
/usr/bin/ld: ClServer.cpp:(.text 0x1cd): undefined reference to `raft_configuration_init(raft_configuration*)'
/usr/bin/ld: ClServer.cpp:(.text 0x226): undefined reference to `raft_configuration_add(raft_configuration*, unsigned long long, char const*, int)'
/usr/bin/ld: ClServer.cpp:(.text 0x232): undefined reference to `raft_configuration_close(raft_configuration*)'
/usr/bin/ld: ClServer.cpp:(.text 0x243): undefined reference to `raft_free(void*)'
/usr/bin/ld: ClServer.cpp:(.text 0x24c): undefined reference to `raft_uv_close(raft_io*)'
/usr/bin/ld: ClServer.cpp:(.text 0x256): undefined reference to `raft_uv_tcp_close(raft_uv_transport*)'
/usr/bin/ld: ClServer.cpp:(.text 0x28f): undefined reference to `raft_bootstrap(raft*, raft_configuration const*)'
/usr/bin/ld: ClServer.cpp:(.text 0x2a4): undefined reference to `raft_configuration_close(raft_configuration*)'
/usr/bin/ld: ClServer.cpp:(.text 0x2b1): undefined reference to `raft_set_snapshot_threshold(raft*, unsigned int)'
/usr/bin/ld: ClServer.cpp:(.text 0x2be): undefined reference to `raft_set_snapshot_trailing(raft*, unsigned int)'
/usr/bin/ld: ClServer.cpp:(.text 0x2cb): undefined reference to `raft_set_pre_vote(raft*, bool)'
/usr/bin/ld: ClServer.cpp:(.text 0x301): undefined reference to `raft_free(void*)'
/usr/bin/ld: ClServer.cpp:(.text 0x30a): undefined reference to `raft_uv_close(raft_io*)'
/usr/bin/ld: ClServer.cpp:(.text 0x314): undefined reference to `raft_uv_tcp_close(raft_uv_transport*)'
/usr/bin/ld: ClServer.cpp:(.text 0x328): undefined reference to `raft_uv_tcp_close(raft_uv_transport*)'
/usr/bin/ld: ClServer.cpp:(.text 0x337): undefined reference to `raft_configuration_close(raft_configuration*)'
/usr/bin/ld: ClServer.cpp:(.text 0x348): undefined reference to `raft_free(void*)'
/usr/bin/ld: ClServer.cpp:(.text 0x351): undefined reference to `raft_uv_close(raft_io*)'
/usr/bin/ld: ClServer.cpp:(.text 0x35b): undefined reference to `raft_uv_tcp_close(raft_uv_transport*)'
/usr/bin/ld: ClServer.cpp:(.text 0x36e): undefined reference to `raft_uv_close(raft_io*)'
/usr/bin/ld: ClServer.cpp:(.text 0x378): undefined reference to `raft_uv_tcp_close(raft_uv_transport*)'
 

Использование 20.04.3 LTS с версией G 9.3.0