C++ Project Error: C Undefined symbols for architecture x86_64: “char_width(char)”

The following error occurred, C++ introduced C library error:

[ 41%] Built target glfw
[ 45%] Linking CXX executable craft
Undefined symbols for architecture x86_64:
"char_width(char)", referenced from:
_gen_sign_buffer(float, float, float, float, int, char const) in main.cpp.o
"cnd_signal(_opaque_pthread_cond_t)", referenced from:
ensure_chunks_worker(Player, Worker) in main.cpp.o
"db_disable()", referenced from:
_main in main.cpp.o
"db_get_key(int, int)", referenced from:
request_chunk(int, int) in main.cpp.o
create_chunk(Chunk, int, int) in main.cpp.o
check_workers() in main.cpp.o
"db_set_key(int, int, int)", referenced from:
parse_buffer(char) in main.cpp.o
"del_buffer(unsigned int)", referenced from:
update_player(Player, float, float, float, float, float, int) in main.cpp.o
interpolate_player(Player) in main.cpp.o
delete_player(int) in main.cpp.o
delete_all_players() in main.cpp.o
gen_sign_buffer(Chunk) in main.cpp.o
generate_chunk(Chunk, WorkerItem) in main.cpp.o
gen_chunk_buffer(Chunk) in main.cpp.o
...
"gen_buffer(int, float)", referenced from:
gen_crosshair_buffer() in main.cpp.o
gen_wireframe_buffer(float, float, float, float) in main.cpp.o
gen_sky_buffer() in main.cpp.o
render_wireframe(Attrib, Player) in main.cpp.o
render_crosshairs(Attrib) in main.cpp.o
_main in main.cpp.o
"make_plant(float, float, float, float, float, float, float, int, float)", referenced from:
gen_plant_buffer(float, float, float, float, int) in main.cpp.o
compute_chunk(WorkerItem) in main.cpp.o
render_item(Attrib) in main.cpp.o
"mtx_unlock(_opaque_pthread_mutex_t)", referenced from:
check_workers() in main.cpp.o
ensure_chunks(Player) in main.cpp.o
worker_run(void) in main.cpp.o
"update_fps(FPS)", referenced from:
_main in main.cpp.o
"client_recv()", referenced from:
_main in main.cpp.o
"client_sign(int, int, int, int, char const)", referenced from:
set_sign(int, int, int, int, char const) in main.cpp.o
on_key(GLFWwindow, int, int, int, int) in main.cpp.o
"client_stop()", referenced from:
_main in main.cpp.o
"client_talk(char const)", referenced from:
parse_command(char const, int) in main.cpp.o
on_key(GLFWwindow, int, int, int, int) in main.cpp.o
"db_auth_set(char, char)", referenced from:
parse_command(char const, int) in main.cpp.o
"is_obstacle(int)", referenced from:
highest_block(float, float) in main.cpp.o
hit_test_face(Player, int, int, int, int) in main.cpp.o
collide(int, float, float, float) in main.cpp.o
render_wireframe(Attrib, Player) in main.cpp.o
on_right_click() in main.cpp.o
"make_player(float, float, float, float, float, float)", referenced from:
gen_player_buffer(float, float, float, float, float) in main.cpp.o
update_player(Player, float, float, float, float, float, int) in main.cpp.o
interpolate_player(Player) in main.cpp.o
_main in main.cpp.o
"make_sphere(float, float, int)", referenced from:
gen_sky_buffer() in main.cpp.o
_main in main.cpp.o
"thrd_create(_opaque_pthread_t**, int ()(void), void)", referenced from:
_main in main.cpp.o
"client_block(int, int, int, int)", referenced from:
set_block(int, int, int, int) in main.cpp.o
"client_chunk(int, int, int)", referenced from:
request_chunk(int, int) in main.cpp.o
create_chunk(Chunk, int, int) in main.cpp.o
check_workers() in main.cpp.o
"client_light(int, int, int, int)", referenced from:
toggle_light(int, int, int) in main.cpp.o
"client_login(char const, char const)", referenced from:
login() in main.cpp.o
"client_start()", referenced from:
_main in main.cpp.o
"create_world(int, int, void ()(int, int, int, int, void), void)", referenced from:
load_chunk(WorkerItem) in main.cpp.o
create_chunk(Chunk, int, int) in main.cpp.o
worker_run(void) in main.cpp.o
"load_program(char const, char const)", referenced from:
_main in main.cpp.o
"malloc_faces(int, int)", referenced from:
gen_cube_buffer(float, float, float, float, int) in main.cpp.o
gen_plant_buffer(float, float, float, float, int) in main.cpp.o
gen_player_buffer(float, float, float, float, float) in main.cpp.o
gen_text_buffer(float, float, float, char) in main.cpp.o
update_player(Player, float, float, float, float, float, int) in main.cpp.o
interpolate_player(Player) in main.cpp.o
gen_sign_buffer(Chunk) in main.cpp.o
...
"string_width(char const)", referenced from:
_gen_sign_buffer(float, float, float, float, int, char const) in main.cpp.o
"client_enable()", referenced from:
_main in main.cpp.o
"db_load_signs(SignList, int, int)", referenced from:
init_chunk(Chunk, int, int) in main.cpp.o
create_chunk(Chunk, int, int) in main.cpp.o
ensure_chunks_worker(Player, Worker) in main.cpp.o
"db_load_state(float, float, float, float, float)", referenced from:
_main in main.cpp.o
"db_save_state(float, float, float, float, float)", referenced from:
_main in main.cpp.o
"set_matrix_2d(float, int, int)", referenced from:
render_crosshairs(Attrib) in main.cpp.o
render_text(Attrib, int, float, float, float, char) in main.cpp.o
"set_matrix_3d(float, int, int, float, float, float, float, float, float, int, int)", referenced from:
ensure_chunks_worker(Player, Worker) in main.cpp.o
render_chunks(Attrib, Player) in main.cpp.o
render_signs(Attrib, Player) in main.cpp.o
render_sign(Attrib, Player) in main.cpp.o
render_players(Attrib, Player) in main.cpp.o
render_sky(Attrib, Player, unsigned int) in main.cpp.o
render_wireframe(Attrib, Player) in main.cpp.o
...
"sign_list_add(SignList, int, int, int, int, char const)", referenced from:
_set_sign(int, int, int, int, int, int, char const, int) in main.cpp.o
"client_connect(char, int)", referenced from:
_main in main.cpp.o
"client_disable()", referenced from:
_main in main.cpp.o
"client_version(int)", referenced from:
_main in main.cpp.o
"db_auth_select(char)", referenced from:
parse_command(char const, int) in main.cpp.o
"db_delete_sign(int, int, int, int)", referenced from:
unset_sign_face(int, int, int, int) in main.cpp.o
_set_sign(int, int, int, int, int, int, char const, int) in main.cpp.o
"db_insert_sign(int, int, int, int, int, int, char const)", referenced from:
_set_sign(int, int, int, int, int, int, char const, int) in main.cpp.o
"db_load_blocks(Map, int, int)", referenced from:
load_chunk(WorkerItem) in main.cpp.o
create_chunk(Chunk, int, int) in main.cpp.o
worker_run(void) in main.cpp.o
"db_load_lights(Map, int, int)", referenced from:
load_chunk(WorkerItem) in main.cpp.o
create_chunk(Chunk, int, int) in main.cpp.o
worker_run(void) in main.cpp.o
"frustum_planes(float () [4], int, float)", referenced from:
ensure_chunks_worker(Player, Worker) in main.cpp.o
render_chunks(Attrib, Player) in main.cpp.o
render_signs(Attrib, Player) in main.cpp.o
"is_transparent(int)", referenced from:
compute_chunk(WorkerItem) in main.cpp.o
"make_character(float, float, float, float, float, char)", referenced from:
gen_text_buffer(float, float, float, char) in main.cpp.o
render_text(Attrib, int, float, float, float, char) in main.cpp.o
"sign_list_free(SignList)", referenced from:
delete_chunks() in main.cpp.o
delete_all_chunks() in main.cpp.o
_main in main.cpp.o
"client_position(float, float, float, float, float)", referenced from:
_main in main.cpp.o
"db_delete_signs(int, int, int)", referenced from:
unset_sign(int, int, int) in main.cpp.o
_set_block(int, int, int, int, int, int, int) in main.cpp.o
"db_insert_block(int, int, int, int, int, int)", referenced from:
_set_block(int, int, int, int, int, int, int) in main.cpp.o
"db_insert_light(int, int, int, int, int, int)", referenced from:
toggle_light(int, int, int) in main.cpp.o
set_light(int, int, int, int, int, int) in main.cpp.o
_set_block(int, int, int, int, int, int, int) in main.cpp.o
parse_buffer(char) in main.cpp.o
"is_destructable(int)", referenced from:
builder_block(int, int, int, int) in main.cpp.o
on_light() in main.cpp.o
on_left_click() in main.cpp.o
on_mouse_button(GLFWwindow, int, int, int) in main.cpp.o
"set_matrix_item(float, int, int, int)", referenced from:
render_item(Attrib) in main.cpp.o
"sign_list_alloc(SignList, int)", referenced from:
init_chunk(Chunk, int, int) in main.cpp.o
create_chunk(Chunk, int, int) in main.cpp.o
ensure_chunks_worker(Player, Worker) in main.cpp.o
"load_png_texture(char const)", referenced from:
_main in main.cpp.o
"sign_list_remove(SignList, int, int, int, int)", referenced from:
unset_sign_face(int, int, int, int) in main.cpp.o
_set_sign(int, int, int, int, int, int, char const, int) in main.cpp.o
"make_character_3d(float, float, float, float, float, int, char)", referenced from:
_gen_sign_buffer(float, float, float, float, int, char const) in main.cpp.o
"db_auth_select_none()", referenced from:
parse_command(char const, int) in main.cpp.o
"db_delete_all_signs()", referenced from:
_main in main.cpp.o
"make_cube_wireframe(float, float, float, float, float)", referenced from:
gen_wireframe_buffer(float, float, float, float) in main.cpp.o
render_wireframe(Attrib, Player) in main.cpp.o
"db_auth_get_selected(char, int, char, int)", referenced from:
login() in main.cpp.o
"sign_list_remove_all(SignList, int, int, int)", referenced from:
unset_sign(int, int, int) in main.cpp.o
_set_block(int, int, int, int, int, int, int) in main.cpp.o
"wrap(char const, int, char, int)", referenced from:
_gen_sign_buffer(float, float, float, float, int, char const) in main.cpp.o
"db_init(char)", referenced from:
_main in main.cpp.o
"map_get(Map, int, int, int)", referenced from:
_hit_test(Map, float, int, f
Solution:
A more symptomatic but not permanent solution is to change the .c file in C dep to .cpp;

Similar Posts: