Как в makeFile указать библиотеку, которую надо использовать?
У меня есть makeFile
CC = gcc
LIBS = `allegro-config --libs -lm`
CFLAGS = -O -Wall
OBJS = alg_gfx.o alg_main.o docked.o elite.o \
intro.o planet.o shipdata.o shipface.o sound.o space.o \
swat.o threed.o vector.o random.o trade.o options.o \
stars.o missions.o pilot.o file.o keyboard.o
EXEC = newkind
all: $(EXEC)
clean:
rm *.o $(EXEC)
.SUFFIXES : .c .o
.c.o:
$(CC) $(CFLAGS) -c $<
$(EXEC): $(OBJS)
$(CC) -o $(EXEC) $(OBJS) $(LIBS)
alg_gfx.o: alg_gfx.c alg_data.h config.h elite.h planet.h gfx.h
alg_main.o: alg_main.c alg_data.h config.h elite.h planet.h gfx.h docked.h\
intro.h shipdata.h shipface.h space.h main.h pilot.h file.h keyboard.h
docked.o: docked.c config.h elite.h planet.h gfx.h
elite.o: elite.c config.h elite.h planet.h vector.h shipdata.h
intro.o: intro.c space.h config.h elite.h planet.h gfx.h vector.h\
shipdata.h shipface.h threed.h
planet.o: planet.c config.h elite.h planet.h
shipdata.o: shipdata.c shipdata.h vector.h
shipface.o: shipface.c config.h elite.h planet.h shipface.h gfx.h
threed.o: threed.c space.h config.h elite.h planet.h gfx.h vector.h shipdata.h\
shipface.h threed.h
vector.o: vector.c config.h vector.h
sound.o: sound.c sound.h
space.o: space.c space.h vector.h alg_data.h config.h elite.h planet.h\
gfx.h docked.h intro.h shipdata.h shipface.h main.h random.h
swat.o: swat.c swat.h elite.h config.h main.h gfx.h alg_data.h shipdata.h\
random.h pilot.h
random.o: random.c random.h
trade.o: trade.c trade.h elite.h config.h
options.o: options.c options.h elite.h config.h gfx.h file.h
stars.o: stars.c stars.h elite.h config.h gfx.h random.h
missions.o: missions.c missions.h config.h elite.h gfx.h planet.h main.h\
vector.h space.h
pilot.o: pilot.c pilot.h config.h elite.h gfx.h vector.h space.h main.h
file.o: file.c file.h config.h elite.h
keyboard.o: keyboard.c keyboard.h
При компиляции возникает ошибка в одном месте. /usr/bin/ld
Как исправить ошибку ?
/usr/bin/ld: alg_gfx.o: in function `gfx_graphics_shutdown':
alg_gfx.c:(.text+0x24): undefined reference to `destroy_bitmap'
/usr/bin/ld: alg_gfx.c:(.text+0x30): undefined reference to `destroy_bitmap'
/usr/bin/ld: alg_gfx.c:(.text+0x3c): undefined reference to `unload_datafile'
/usr/bin/ld: alg_gfx.o: in function `gfx_update_screen':
alg_gfx.c:(.text+0x5d): undefined reference to `rest'
/usr/bin/ld: alg_gfx.c:(.text+0x78): undefined reference to `screen'
/usr/bin/ld: alg_gfx.c:(.text+0xae): undefined reference to `screen'
/usr/bin/ld: alg_gfx.c:(.text+0xba): undefined reference to `blit'
/usr/bin/ld: alg_gfx.c:(.text+0xc1): undefined reference to `screen'
/usr/bin/ld: alg_gfx.o: in function `gfx_draw_aa_line':
alg_gfx.c:(.text+0x4c8): undefined reference to `fdiv'
/usr/bin/ld: alg_gfx.c:(.text+0x4ed): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.c:(.text+0x51f): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.c:(.text+0x534): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.c:(.text+0x59e): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.c:(.text+0x5cb): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.o:alg_gfx.c:(.text+0x5df): more undefined references to `fmul' follow
/usr/bin/ld: alg_gfx.o: in function `gfx_draw_aa_line':
alg_gfx.c:(.text+0x6cb): undefined reference to `fdiv'
/usr/bin/ld: alg_gfx.c:(.text+0x6f0): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.c:(.text+0x722): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.c:(.text+0x737): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.c:(.text+0x79f): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.c:(.text+0x7cc): undefined reference to `fmul'
/usr/bin/ld: alg_gfx.o:alg_gfx.c:(.text+0x7e0): more undefined references to `fmul' follow
/usr/bin/ld: alg_gfx.o: in function `gfx_graphics_startup':
alg_gfx.c:(.text+0x9d4): undefined reference to `set_gfx_mode'
/usr/bin/ld: alg_gfx.c:(.text+0x9ea): undefined reference to `load_datafile'
/usr/bin/ld: alg_gfx.c:(.text+0xa09): undefined reference to `load_bitmap'
/usr/bin/ld: alg_gfx.c:(.text+0xa21): undefined reference to `set_palette'
/usr/bin/ld: alg_gfx.c:(.text+0xa28): undefined reference to `gfx_driver'
/usr/bin/ld: alg_gfx.c:(.text+0xa42): undefined reference to `create_bitmap'
/usr/bin/ld: alg_gfx.c:(.text+0xa51): undefined reference to `clear_bitmap'
/usr/bin/ld: alg_gfx.c:(.text+0xa81): undefined reference to `blit'
/usr/bin/ld: alg_gfx.c:(.text+0xae9): undefined reference to `install_int'
/usr/bin/ld: alg_gfx.c:(.text+0xb2e): undefined reference to `set_gfx_mode'
/usr/bin/ld: alg_gfx.c:(.text+0xb3f): undefined reference to `allegro_message'
/usr/bin/ld: alg_gfx.c:(.text+0xb65): undefined reference to `set_gfx_mode'
/usr/bin/ld: alg_gfx.c:(.text+0xb7d): undefined reference to `allegro_message'
/usr/bin/ld: alg_gfx.c:(.text+0xba6): undefined reference to `set_gfx_mode'
/usr/bin/ld: alg_gfx.c:(.text+0xbb7): undefined reference to `allegro_message'
/usr/bin/ld: alg_gfx.o: in function `gfx_display_text':
alg_gfx.c:(.text+0xcd8): undefined reference to `text_mode'
/usr/bin/ld: alg_gfx.c:(.text+0xcf3): undefined reference to `_textmode'
/usr/bin/ld: alg_gfx.c:(.text+0xd0e): undefined reference to `textout_ex'
/usr/bin/ld: alg_gfx.o: in function `gfx_display_colour_text':
alg_gfx.c:(.text+0xd3a): undefined reference to `text_mode'
/usr/bin/ld: alg_gfx.c:(.text+0xd55): undefined reference to `_textmode'
/usr/bin/ld: alg_gfx.c:(.text+0xd6d): undefined reference to `textout_ex'
/usr/bin/ld: alg_gfx.o: in function `gfx_display_centre_text':
alg_gfx.c:(.text+0xdb7): undefined reference to `text_mode'
/usr/bin/ld: alg_gfx.c:(.text+0xdcf): undefined reference to `_textmode'
/usr/bin/ld: alg_gfx.c:(.text+0xdef): undefined reference to `textout_centre_ex'
/usr/bin/ld: alg_gfx.o: in function `gfx_display_pretty_text':
alg_gfx.c:(.text+0xf7c): undefined reference to `text_mode'
/usr/bin/ld: alg_gfx.c:(.text+0xf98): undefined reference to `_textmode'
/usr/bin/ld: alg_gfx.c:(.text+0xfb1): undefined reference to `textout_ex'
/usr/bin/ld: alg_gfx.o: in function `gfx_draw_scanner':
alg_gfx.c:(.text+0x106f): undefined reference to `blit'
/usr/bin/ld: alg_gfx.o: in function `gfx_set_clip_region':
alg_gfx.c:(.text+0x109d): undefined reference to `set_clip'
/usr/bin/ld: alg_gfx.o: in function `gfx_request_file':
alg_gfx.c:(.text+0x1438): undefined reference to `screen'
/usr/bin/ld: alg_gfx.c:(.text+0x143d): undefined reference to `show_mouse'
/usr/bin/ld: alg_gfx.c:(.text+0x145c): undefined reference to `file_select_ex'
/usr/bin/ld: alg_gfx.c:(.text+0x1468): undefined reference to `show_mouse'
/usr/bin/ld: alg_main.o: in function `draw_cross':
alg_main.c:(.text+0x206): undefined reference to `xor_mode'
/usr/bin/ld: alg_main.c:(.text+0x23a): undefined reference to `xor_mode'
/usr/bin/ld: alg_main.c:(.text+0x278): undefined reference to `xor_mode'
/usr/bin/ld: alg_main.c:(.text+0x2ac): undefined reference to `xor_mode'
/usr/bin/ld: alg_main.o: in function `handle_flight_keys':
alg_main.c:(.text+0x103a): undefined reference to `poll_joystick'
/usr/bin/ld: alg_main.c:(.text+0x1040): undefined reference to `joy'
/usr/bin/ld: alg_main.c:(.text+0x1049): undefined reference to `joy'
/usr/bin/ld: alg_main.c:(.text+0x1052): undefined reference to `joy'
/usr/bin/ld: alg_main.c:(.text+0x105b): undefined reference to `joy'
/usr/bin/ld: alg_main.c:(.text+0x1064): undefined reference to `joy'
/usr/bin/ld: alg_main.o:alg_main.c:(.text+0x1077): more undefined references to `joy' follow
/usr/bin/ld: alg_main.o: in function `set_commander_name':
alg_main.c:(.text+0x14dc): undefined reference to `get_filename'
/usr/bin/ld: alg_main.o: in function `load_commander_screen':
alg_main.c:(.text+0x184c): undefined reference to `readkey'
/usr/bin/ld: alg_main.o: in function `initialise_allegro':
alg_main.c:(.text+0x1b96): undefined reference to `_install_allegro_version_check'
/usr/bin/ld: alg_main.c:(.text+0x1b9b): undefined reference to `install_keyboard'
/usr/bin/ld: alg_main.c:(.text+0x1ba0): undefined reference to `install_timer'
/usr/bin/ld: alg_main.c:(.text+0x1ba5): undefined reference to `install_mouse'
/usr/bin/ld: alg_main.c:(.text+0x1bb9): undefined reference to `install_joystick'
/usr/bin/ld: alg_main.c:(.text+0x1bc3): undefined reference to `num_joysticks'
/usr/bin/ld: docked.o: in function `calc_distance_to_planet':
docked.c:(.text+0xdf): undefined reference to `sqrt'
/usr/bin/ld: sound.o: in function `snd_sound_startup':
sound.c:(.text+0x26): undefined reference to `install_sound'
/usr/bin/ld: sound.c:(.text+0x40): undefined reference to `load_sample'
/usr/bin/ld: sound.o: in function `snd_sound_shutdown':
sound.c:(.text+0x8b): undefined reference to `destroy_sample'
/usr/bin/ld: sound.o: in function `snd_play_sample':
sound.c:(.text+0x12a): undefined reference to `play_sample'
/usr/bin/ld: sound.o: in function `snd_play_midi':
sound.c:(.text+0x18e): undefined reference to `play_midi'
/usr/bin/ld: sound.c:(.text+0x1a0): undefined reference to `play_midi'
/usr/bin/ld: sound.o: in function `snd_stop_midi':
sound.c:(.text+0x1ba): undefined reference to `play_midi'
/usr/bin/ld: space.o: in function `move_univ_object':
space.c:(.text+0x2cb): undefined reference to `sqrt'
/usr/bin/ld: space.o: in function `update_altitude':
space.c:(.text+0x600): undefined reference to `sqrt'
/usr/bin/ld: swat.o: in function `add_new_ship':
swat.c:(.text+0x217): undefined reference to `sqrt'
/usr/bin/ld: vector.o: in function `unit_vector':
vector.c:(.text+0x278): undefined reference to `sqrt'
/usr/bin/ld: pilot.o: in function `auto_pilot_ship':
pilot.c:(.text+0x54f): undefined reference to `sqrt'
/usr/bin/ld: keyboard.o: in function `kbd_poll_keyboard':
keyboard.c:(.text+0x1d): undefined reference to `poll_keyboard'
/usr/bin/ld: keyboard.c:(.text+0x24): undefined reference to `key'
/usr/bin/ld: keyboard.c:(.text+0x34): undefined reference to `key'
/usr/bin/ld: keyboard.c:(.text+0x44): undefined reference to `key'
/usr/bin/ld: keyboard.c:(.text+0x54): undefined reference to `key'
/usr/bin/ld: keyboard.c:(.text+0x64): undefined reference to `key'
/usr/bin/ld: keyboard.o:keyboard.c:(.text+0x74): more undefined references to `key' follow
/usr/bin/ld: keyboard.o: in function `kbd_poll_keyboard':
keyboard.c:(.text+0x2fb): undefined reference to `keypressed'
/usr/bin/ld: keyboard.c:(.text+0x304): undefined reference to `readkey'
/usr/bin/ld: keyboard.o: in function `kbd_read_key':
keyboard.c:(.text+0x32c): undefined reference to `readkey'
/usr/bin/ld: keyboard.o: in function `kbd_clear_key_buffer':
keyboard.c:(.text+0x372): undefined reference to `keypressed'
/usr/bin/ld: keyboard.c:(.text+0x37b): undefined reference to `readkey'
collect2: error: ld returned 1 exit status
make: *** [makefile:41: newkind] Error 1