如何在Linux中静态链接到SDL2

问题描述

我需要静态链接到sdl2。

这是我当前的文件

EXE_FILE = bin/MapJumper
OBJ_FILES = obj/main.o
FLAGS = --std=c++17 -w -fpermissive -static -static-libstdc++ -static-libgcc
CC = g++

exe : clean
exe : $(EXE_FILE)

debug: FLAGS += -ggdb
debug : exe

windows: EXE_FILE = bin/mapJumper.exe
windows: CC = x86_64-w64-mingw32-g++
windows: exe

$(EXE_FILE) : $(OBJ_FILES)
    $(CC) -o $(EXE_FILE) $(OBJ_FILES) -Bstatic `pkg-config --libs sdl2 SDL2_image SDL2_ttf SDL2_mixer` -lSDL2main $(FLAGS)

obj/main.o : src/main.cpp src/bounds.h src/player.h src/texture.h src/world.h
$(CC) -c -o obj/main.o src/main.cpp $(FLAGS)
run : exe
    $(EXE_FILE) &

clean:
    rm -f *.o obj/main.o

在尝试静态链接SDL2-之前,它一直运行良好。

使用make运行此命令后,出现以下错误

jc@jc-Inspiron-560:~/Desktop/c++Dev/Map Jumper$ make
rm -f *.o obj/main.o
g++ -c -o obj/main.o src/main.cpp --std=c++17 -w -fpermissive -static -static-libstdc++ -static-libgcc
g++ -o bin/MapJumper obj/main.o -Bstatic `pkg-config --libs sdl2 SDL2_image SDL2_ttf SDL2_mixer` -lSDL2main --std=c++17 -w -fpermissive -static -static-libstdc++ -static-libgcc
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(eh_alloc.o): in function `(anonymous namespace)::pool::free(void*) [clone .constprop.0]':
(.text._ZN12_GLOBAL__N_14pool4freeEPv.constprop.0+0x1d): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZN12_GLOBAL__N_14pool4freeEPv.constprop.0+0xc8): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(eh_alloc.o): in function `(anonymous namespace)::pool::allocate(unsigned long) [clone .constprop.0]':
(.text._ZN12_GLOBAL__N_14pool8allocateEm.constprop.0+0x1e): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZN12_GLOBAL__N_14pool8allocateEm.constprop.0+0x97): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(locale.o): in function `__gnu_cxx::__scoped_lock::~__scoped_lock()':
(.text._ZN9__gnu_cxx13__scoped_lockD2Ev[_ZN9__gnu_cxx13__scoped_lockD5Ev]+0x16): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(locale.o): in function `std::locale::_Impl::_M_install_cache(std::locale::facet const*,unsigned long)':
(.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEm+0x50): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt6locale5_Impl16_M_install_cacheEPKNS_5facetEm+0xcd): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(locale_init.o): in function `std::locale::locale()':
(.text._ZNSt6localeC2Ev+0x4f): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt6localeC2Ev+0x78): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(locale_init.o): in function `std::locale::global(std::locale const&)':
(.text._ZNSt6locale6globalERKS_+0x45): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt6locale6globalERKS_+0xc4): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(c++locale.o): in function `std::Catalogs::_M_erase(int)':
(.text._ZNSt8Catalogs8_M_eraseEi+0x1f): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt8Catalogs8_M_eraseEi+0x7f): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: (.text._ZNSt8Catalogs8_M_eraseEi+0xf3): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(c++locale.o): in function `std::Catalogs::_M_get(int) const':
(.text._ZNKSt8Catalogs6_M_getEi+0x20): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNKSt8Catalogs6_M_getEi+0x85): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libstdc++.a(c++locale.o): in function `std::Catalogs::_M_add(char const*,std::locale)':
(.text._ZNSt8Catalogs6_M_addEPKcSt6locale+0x3d): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text._ZNSt8Catalogs6_M_addEPKcSt6locale+0xd4): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_bases.part.0':
(.text+0x1698): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_table_bases':
(.text+0x17ac): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__deregister_frame_info_bases':
(.text+0x1872): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text+0x18ba): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: (.text+0x193d): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `_Unwind_Find_FDE':
(.text+0x1a74): undefined reference to `pthread_mutex_lock'
/usr/bin/ld: (.text+0x1b98): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: (.text+0x1bd9): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_bases.part.0':
(.text+0x16cb): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/libgcc_eh.a(unwind-dw2-fde-dip.o): in function `__register_frame_info_table_bases':
(.text+0x17df): undefined reference to `pthread_mutex_unlock'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_image.a(IMG_jpg.o): in function `IMG_InitJPG':
(.text+0x3f5): undefined reference to `jpeg_calc_output_dimensions'
/usr/bin/ld: (.text+0x403): undefined reference to `jpeg_CreateDecompress'
/usr/bin/ld: (.text+0x411): undefined reference to `jpeg_destroy_decompress'
/usr/bin/ld: (.text+0x41f): undefined reference to `jpeg_finish_decompress'
/usr/bin/ld: (.text+0x42d): undefined reference to `jpeg_read_header'
/usr/bin/ld: (.text+0x43b): undefined reference to `jpeg_read_scanlines'
/usr/bin/ld: (.text+0x449): undefined reference to `jpeg_resync_to_restart'
/usr/bin/ld: (.text+0x457): undefined reference to `jpeg_start_decompress'
/usr/bin/ld: (.text+0x465): undefined reference to `jpeg_CreateCompress'
/usr/bin/ld: (.text+0x473): undefined reference to `jpeg_start_compress'
/usr/bin/ld: (.text+0x481): undefined reference to `jpeg_set_quality'
/usr/bin/ld: (.text+0x48f): undefined reference to `jpeg_set_defaults'
/usr/bin/ld: (.text+0x49d): undefined reference to `jpeg_write_scanlines'
/usr/bin/ld: (.text+0x4ab): undefined reference to `jpeg_finish_compress'
/usr/bin/ld: (.text+0x4b9): undefined reference to `jpeg_destroy_compress'
/usr/bin/ld: (.text+0x4c7): undefined reference to `jpeg_std_error'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_image.a(IMG_png.o): in function `IMG_InitPNG':
(.text+0x3935): undefined reference to `png_create_info_struct'
/usr/bin/ld: (.text+0x3943): undefined reference to `png_create_read_struct'
/usr/bin/ld: (.text+0x3951): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: (.text+0x395f): undefined reference to `png_get_IHDR'
/usr/bin/ld: (.text+0x396d): undefined reference to `png_get_io_ptr'
/usr/bin/ld: (.text+0x397b): undefined reference to `png_get_channels'
/usr/bin/ld: (.text+0x3989): undefined reference to `png_get_pltE'
/usr/bin/ld: (.text+0x3997): undefined reference to `png_get_tRNS'
/usr/bin/ld: (.text+0x39a5): undefined reference to `png_get_valid'
/usr/bin/ld: (.text+0x39b3): undefined reference to `png_read_image'
/usr/bin/ld: (.text+0x39c1): undefined reference to `png_read_info'
/usr/bin/ld: (.text+0x39cf): undefined reference to `png_read_update_info'
/usr/bin/ld: (.text+0x39dd): undefined reference to `png_set_expand'
/usr/bin/ld: (.text+0x39eb): undefined reference to `png_set_gray_to_rgb'
/usr/bin/ld: (.text+0x39f9): undefined reference to `png_set_packing'
/usr/bin/ld: (.text+0x3a07): undefined reference to `png_set_read_fn'
/usr/bin/ld: (.text+0x3a15): undefined reference to `png_set_strip_16'
/usr/bin/ld: (.text+0x3a23): undefined reference to `png_set_interlace_handling'
/usr/bin/ld: (.text+0x3a31): undefined reference to `png_sig_cmp'
/usr/bin/ld: (.text+0x3a3f): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: (.text+0x3a4d): undefined reference to `png_create_write_struct'
/usr/bin/ld: (.text+0x3a5b): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: (.text+0x3a69): undefined reference to `png_set_write_fn'
/usr/bin/ld: (.text+0x3a77): undefined reference to `png_set_IHDR'
/usr/bin/ld: (.text+0x3a85): undefined reference to `png_write_info'
/usr/bin/ld: (.text+0x3a93): undefined reference to `png_set_rows'
/usr/bin/ld: (.text+0x3aa1): undefined reference to `png_write_png'
/usr/bin/ld: (.text+0x3aaf): undefined reference to `png_set_pltE'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_image.a(IMG_tif.o): in function `IMG_InitTIF':
(.text+0xe1): undefined reference to `TIFFClientOpen'
/usr/bin/ld: (.text+0xef): undefined reference to `TIFFClose'
/usr/bin/ld: (.text+0xfd): undefined reference to `TIFfgetField'
/usr/bin/ld: (.text+0x10b): undefined reference to `TIFFReadRGBaimageOriented'
/usr/bin/ld: (.text+0x119): undefined reference to `TIFFSetErrorHandler'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_image.a(IMG_webp.o): in function `IMG_InitWEBP':
(.text+0x131): undefined reference to `WebPGetFeaturesInternal'
/usr/bin/ld: (.text+0x13f): undefined reference to `WebPDecodeRGBInto'
/usr/bin/ld: (.text+0x14d): undefined reference to `WebPDecodeRGBAInto'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_initFontMetrics':
(.text+0x358): undefined reference to `FT_MulFix'
/usr/bin/ld: (.text+0x373): undefined reference to `FT_MulFix'
/usr/bin/ld: (.text+0x399): undefined reference to `FT_MulFix'
/usr/bin/ld: (.text+0x3b4): undefined reference to `FT_MulFix'
/usr/bin/ld: (.text+0x3cf): undefined reference to `FT_MulFix'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o):(.text+0x3e6): more undefined references to `FT_MulFix' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `Find_Glyph':
(.text+0x4aa): undefined reference to `FT_Get_Char_Index'
/usr/bin/ld: (.text+0x572): undefined reference to `FT_Load_Glyph'
/usr/bin/ld: (.text+0x703): undefined reference to `FT_Render_Glyph'
/usr/bin/ld: (.text+0x7b2): undefined reference to `FT_Done_Glyph'
/usr/bin/ld: (.text+0x824): undefined reference to `FT_Get_Glyph'
/usr/bin/ld: (.text+0x835): undefined reference to `FT_stroker_New'
/usr/bin/ld: (.text+0x856): undefined reference to `FT_stroker_Set'
/usr/bin/ld: (.text+0x868): undefined reference to `FT_Glyph_stroke'
/usr/bin/ld: (.text+0x872): undefined reference to `FT_stroker_Done'
/usr/bin/ld: (.text+0x886): undefined reference to `FT_Glyph_To_Bitmap'
/usr/bin/ld: (.text+0x969): undefined reference to `FT_Outline_Transform'
/usr/bin/ld: (.text+0xd73): undefined reference to `FT_Done_Glyph'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_SizeUTF8_Internal':
(.text+0xf8d): undefined reference to `FT_Get_Kerning'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_Init':
(.text+0x106c): undefined reference to `FT_Init_FreeType'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_CloseFont':
(.text+0x10fb): undefined reference to `FT_Done_Face'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_OpenFontIndexRW':
(.text+0x122c): undefined reference to `FT_Open_Face'
/usr/bin/ld: (.text+0x12d4): undefined reference to `FT_Set_Charmap'
/usr/bin/ld: (.text+0x1347): undefined reference to `FT_Select_Size'
/usr/bin/ld: (.text+0x139e): undefined reference to `FT_Set_Char_Size'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_RenderUTF8_Solid':
(.text+0x1ad2): undefined reference to `FT_Get_Kerning'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_RenderUTF8_Shaded':
(.text+0x21fd): undefined reference to `FT_Get_Kerning'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_RenderUTF8_Blended':
(.text+0x2911): undefined reference to `FT_Get_Kerning'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_RenderUTF8_Blended_Wrapped':
(.text+0x3044): undefined reference to `FT_Get_Kerning'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_GetFontKerningSize':
(.text+0x39cd): undefined reference to `FT_Get_Kerning'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o):(.text+0x3a78): more undefined references to `FT_Get_Kerning' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_GlyphIsProvided':
(.text+0x1587): undefined reference to `FT_Get_Char_Index'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_ttf.a(SDL_ttf.o): in function `TTF_Quit':
(.text+0x3998): undefined reference to `FT_Done_FreeType'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_mixer.a(music_flac.o): in function `FLAC_Load':
(.text+0x15): undefined reference to `FLAC__stream_decoder_new'
/usr/bin/ld: (.text+0x23): undefined reference to `FLAC__stream_decoder_delete'
/usr/bin/ld: (.text+0x31): undefined reference to `FLAC__stream_decoder_init_stream'
/usr/bin/ld: (.text+0x3f): undefined reference to `FLAC__stream_decoder_finish'
/usr/bin/ld: (.text+0x4d): undefined reference to `FLAC__stream_decoder_flush'
/usr/bin/ld: (.text+0x5b): undefined reference to `FLAC__stream_decoder_process_single'
/usr/bin/ld: (.text+0x69): undefined reference to `FLAC__stream_decoder_process_until_end_of_Metadata'
/usr/bin/ld: (.text+0x77): undefined reference to `FLAC__stream_decoder_process_until_end_of_stream'
/usr/bin/ld: (.text+0x85): undefined reference to `FLAC__stream_decoder_seek_absolute'
/usr/bin/ld: (.text+0x93): undefined reference to `FLAC__stream_decoder_get_state'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_mixer.a(music_fluidsynth.o): in function `FLUIDSYNTH_Load':
(.text+0x15): undefined reference to `delete_fluid_player'
/usr/bin/ld: (.text+0x23): undefined reference to `delete_fluid_settings'
/usr/bin/ld: (.text+0x31): undefined reference to `delete_fluid_synth'
/usr/bin/ld: (.text+0x3f): undefined reference to `fluid_player_add'
/usr/bin/ld: (.text+0x4d): undefined reference to `fluid_player_add_mem'
/usr/bin/ld: (.text+0x5b): undefined reference to `fluid_player_get_status'
/usr/bin/ld: (.text+0x69): undefined reference to `fluid_player_play'
/usr/bin/ld: (.text+0x77): undefined reference to `fluid_player_set_loop'
/usr/bin/ld: (.text+0x85): undefined reference to `fluid_player_stop'
/usr/bin/ld: (.text+0x93): undefined reference to `fluid_settings_setnum'
/usr/bin/ld: (.text+0xa1): undefined reference to `fluid_synth_get_settings'
/usr/bin/ld: (.text+0xaf): undefined reference to `fluid_synth_set_gain'
/usr/bin/ld: (.text+0xbd): undefined reference to `fluid_synth_sfload'
/usr/bin/ld: (.text+0xcb): undefined reference to `fluid_synth_write_s16'
/usr/bin/ld: (.text+0xd9): undefined reference to `new_fluid_player'
/usr/bin/ld: (.text+0xe7): undefined reference to `new_fluid_settings'
/usr/bin/ld: (.text+0xf5): undefined reference to `new_fluid_synth'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_mixer.a(music_modplug.o): in function `MOdplUG_Load':
(.text+0x11): undefined reference to `Modplug_Load'
/usr/bin/ld: (.text+0x1f): undefined reference to `Modplug_Unload'
/usr/bin/ld: (.text+0x2d): undefined reference to `Modplug_Read'
/usr/bin/ld: (.text+0x3b): undefined reference to `Modplug_Seek'
/usr/bin/ld: (.text+0x49): undefined reference to `Modplug_GetSettings'
/usr/bin/ld: (.text+0x57): undefined reference to `Modplug_SetSettings'
/usr/bin/ld: (.text+0x65): undefined reference to `Modplug_SetMasterVolume'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_mixer.a(music_mpg123.o): in function `MPG123_Load':
(.text+0x15): undefined reference to `mpg123_close'
/usr/bin/ld: (.text+0x23): undefined reference to `mpg123_delete'
/usr/bin/ld: (.text+0x31): undefined reference to `mpg123_exit'
/usr/bin/ld: (.text+0x3f): undefined reference to `mpg123_format'
/usr/bin/ld: (.text+0x4d): undefined reference to `mpg123_format_none'
/usr/bin/ld: (.text+0x5b): undefined reference to `mpg123_getformat'
/usr/bin/ld: (.text+0x69): undefined reference to `mpg123_init'
/usr/bin/ld: (.text+0x77): undefined reference to `mpg123_new'
/usr/bin/ld: (.text+0x85): undefined reference to `mpg123_open_handle'
/usr/bin/ld: (.text+0x93): undefined reference to `mpg123_plain_strerror'
/usr/bin/ld: (.text+0xa1): undefined reference to `mpg123_rates'
/usr/bin/ld: (.text+0xaf): undefined reference to `mpg123_read'
/usr/bin/ld: (.text+0xbd): undefined reference to `mpg123_replace_reader_handle'
/usr/bin/ld: (.text+0xcb): undefined reference to `mpg123_seek'
/usr/bin/ld: (.text+0xd9): undefined reference to `mpg123_strerror'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_mixer.a(music_ogg.o): in function `OGG_Load':
(.text+0x11): undefined reference to `ov_clear'
/usr/bin/ld: (.text+0x1f): undefined reference to `ov_info'
/usr/bin/ld: (.text+0x2d): undefined reference to `ov_comment'
/usr/bin/ld: (.text+0x3b): undefined reference to `ov_open_callbacks'
/usr/bin/ld: (.text+0x49): undefined reference to `ov_pcm_total'
/usr/bin/ld: (.text+0x57): undefined reference to `ov_read'
/usr/bin/ld: (.text+0x65): undefined reference to `ov_time_seek'
/usr/bin/ld: (.text+0x73): undefined reference to `ov_pcm_seek'
/usr/bin/ld: (.text+0x81): undefined reference to `ov_pcm_tell'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2_mixer.a(music_opus.o): in function `OPUS_Load':
(.text+0x11): undefined reference to `op_open_callbacks'
/usr/bin/ld: (.text+0x1f): undefined reference to `op_free'
/usr/bin/ld: (.text+0x2d): undefined reference to `op_head'
/usr/bin/ld: (.text+0x3b): undefined reference to `op_seekable'
/usr/bin/ld: (.text+0x49): undefined reference to `op_read'
/usr/bin/ld: (.text+0x57): undefined reference to `op_pcm_seek'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_dynapi.o): in function `SDL_InitDynamicAPI':
(.text+0x2552): undefined reference to `dlopen'
/usr/bin/ld: (.text+0x2569): undefined reference to `dlsym'
/usr/bin/ld: (.text+0x25a4): undefined reference to `dlclose'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_sysloadso.o): in function `SDL_Loadobject_REAL':
(.text+0x14): undefined reference to `dlopen'
/usr/bin/ld: (.text+0x1c): undefined reference to `dlerror'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_sysloadso.o): in function `SDL_LoadFunction_REAL':
(.text+0x7a): undefined reference to `dlsym'
/usr/bin/ld: (.text+0x12d): undefined reference to `dlsym'
/usr/bin/ld: (.text+0x164): undefined reference to `dlsym'
/usr/bin/ld: (.text+0x17d): undefined reference to `dlerror'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_sysloadso.o): in function `SDL_Unloadobject_REAL':
(.text+0x1aa): undefined reference to `dlclose'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandvideo.o): in function `Wayland_VideoQuit':
(.text+0x34d): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: (.text+0x42f): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: (.text+0x44e): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: (.text+0x464): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x46c): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: (.text+0x482): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x48a): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: (.text+0x499): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: (.text+0x4a8): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandvideo.o): in function `display_handle_done':
(.text+0x55e): undefined reference to `wl_proxy_set_user_data'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandvideo.o): in function `Wayland_VideoInit':
(.text+0x828): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0x843): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandvideo.o): in function `display_handle_global':
(.text+0xae5): undefined reference to `wl_proxy_marshal_constructor_versioned'
/usr/bin/ld: (.text+0xb58): undefined reference to `wl_proxy_marshal_constructor_versioned'
/usr/bin/ld: (.text+0xbca): undefined reference to `wl_proxy_marshal_constructor_versioned'
/usr/bin/ld: (.text+0xc03): undefined reference to `wl_proxy_marshal_constructor_versioned'
/usr/bin/ld: (.text+0xc63): undefined reference to `wl_proxy_marshal_constructor_versioned'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandvideo.o):(.text+0xcd3): more undefined references to `wl_proxy_marshal_constructor_versioned' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandvideo.o): in function `handle_ping_zxdg_shell':
(.text+0x4ff): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandvideo.o): in function `handle_ping_xdg_wm_base':
(.text+0x51f): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandvideo.o): in function `display_handle_global':
(.text+0xb05): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: (.text+0xb97): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: (.text+0xc1f): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: (.text+0xc81): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): in function `update_scale_factor':
(.text+0x2a6): undefined reference to `wl_proxy_get_user_data'
/usr/bin/ld: (.text+0x30d): undefined reference to `wl_proxy_get_user_data'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): in function `handle_configure_zxdg_shell_surface':
(.text+0x758): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x7aa): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x7c7): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0x7e5): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x7f8): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x804): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x80c): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): in function `handle_configure_xdg_shell_surface':
(.text+0x8b8): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x90a): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x927): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0x945): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x958): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x964): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x96c): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): in function `SetFullscreen.isra.0':
(.text+0x9af): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x9df): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x9f0): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0xa10): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): in function `Wayland_RestoreWindow':
(.text+0xb4e): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o):(.text+0xc16): more undefined references to `wl_proxy_marshal' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): in function `Wayland_CreateWindow':
(.text+0xd74): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0xd8a): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: (.text+0xdb1): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0xdcd): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0xde3): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: (.text+0xdfb): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0xe1d): undefined reference to `wl_proxy_create'
/usr/bin/ld: (.text+0xedd): undefined reference to `wl_proxy_set_user_data'
/usr/bin/ld: (.text+0xef0): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: (.text+0xf15): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: (.text+0xf53): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0xf78): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0xf96): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0xfb4): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0xfc7): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0xfd3): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0xfdb): undefined reference to `wl_proxy_destroy'
/usr/bin/ld: (.text+0xffb): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x1078): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0x10a0): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x10d3): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0x10ef): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0x1195): undefined reference to `wl_proxy_set_user_data'
/usr/bin/ld: (.text+0x11a8): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: (.text+0x11c5): undefined reference to `wl_proxy_set_user_data'
/usr/bin/ld: (.text+0x11d8): undefined reference to `wl_proxy_add_listener'
/usr/bin/ld: (.text+0x11fb): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0x1216): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): in function `Wayland_SetwindowSize':
(.text+0x1280): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x12da): undefined reference to `wl_proxy_marshal_constructor'
/usr/bin/ld: (.text+0x12f8): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x130c): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x1318): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): in function `Wayland_SetwindowTitle':
(.text+0x1362): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: (.text+0x1393): undefined reference to `wl_proxy_marshal'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o):(.text+0x13fc): more undefined references to `wl_proxy_marshal' follow
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libSDL2.a(SDL_waylandwindow.o): in function `Wayland_DestroyWindow':
make: *** [Makefile:17: bin/MapJumper] Error 1
jc@jc-Inspiron-560:~/Desktop/c++Dev/Map Jumper$ 

还有很多错误,但是出于堆栈溢出的原因,我不得不将其缩短

如果这是有用的信息,我正在运行linux mint ...

编辑:这是github仓库:https://github.com/jcsq6/Map-Jumper

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)