小编Alu*_*iuN的帖子

使用SDL 2和-static进行编译时,是否收到对各种Windows库的未定义引用?

我正在对SDL2中的Wolfenstein 3D引擎进行修改(使用Wolf4SDL作为基础),但是遇到了一个问题-在链接器选项中使用-static时,我得到了很多未定义的对各种事物的引用。这是我的构建日志,以显示我的意思:

-------------- Build: Debug in Lazarus (compiler: GNU GCC Compiler)---------------
i686-w64-mingw32-g++.exe -LC:\SDL2\lib -o Lazarus.exe .objs\alu_cache.o .objs\alu_dbg_mem.o .objs\alu_gfx.o .objs\alu_hud.o .objs\alu_in.o .objs\alu_me_core.o .objs\alu_me_gui.o .objs\alu_me_symbols.o .objs\alu_me_textinput.o .objs\alu_me_tools.o .objs\alu_me_windows.o .objs\alu_menu.o .objs\alu_pak.o .objs\alu_particles.o .objs\asmcomp.o .objs\id_us_1.o .objs\vieasm.o .objs\wl_act1.o .objs\wl_act2.o .objs\wl_agent.o .objs\wl_debug.o .objs\wl_dir3dspr.o .objs\wl_draw.o .objs\wl_floorceiling.o .objs\wl_game.o .objs\wl_inter.o .objs\wl_main.o .objs\wl_play.o .objs\wl_state.o .objs\wl_text.o  -static -pg -lgmon  -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -mwindows 
C:\SDL2\lib\libSDL2.a(SDL_systimer.o): In function `timeSetPeriod': 
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:58: undefined reference to `_imp__timeBeginPeriod@4' 
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:52: undefined reference to `_imp__timeEndPeriod@4' 
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:58: undefined reference to `_imp__timeBeginPeriod@4' 
C:\SDL2\lib\libSDL2.a(SDL_systimer.o): In function `SDL_TicksInit': 
/Users/slouken/release/SDL/SDL2-2.0.3-source/foo-x86/../src/timer/windows/SDL_systimer.c:106: undefined reference …
Run Code Online (Sandbox Code Playgroud)

c++ sdl sdl-2

2
推荐指数
1
解决办法
2487
查看次数

标签 统计

c++ ×1

sdl ×1

sdl-2 ×1