我正在尝试在我编写的测试中静态链接 libsdl。我所做的是:
g++ test.cpp -Wl,-Bstatic $(sdl-config --static-libs) -Wl,-Bdynamic
这给了我错误:
/usr/lib/x86_64-linux-gnu//libSDL.a(SDL_x11gl.o): In function`X11_GL_LoadLibrary':
(.text+0x703): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: cannot find -lasound
/usr/bin/ld: cannot find -lpulse-simple
/usr/bin/ld: cannot find -lpulse
collect2: error: ld returned 1 exit status
我添加了行“-L/usr/lib/x86_64-linux-gnu/”(libasound.so 所在的目录),但没有任何变化。有什么解决办法吗?