Receiving undefined references to various Windows libraries when compiling with SDL 2 and -static?

孤街浪徒 提交于 2019-12-02 00:45:53

OK, fixed the problem - I needed to link a variety of Windows libraries, namely Ole32, Oleaut32, Imm32, Winmm and Version. Not sure why this wasn't the case for SDL 1; it wasn't mentioned in the Migration Guide either so I'm not sure where the difference comes from.

For me this meant "use pkg-config --static" since I had compiled a static only version and wanted to use that.

Guess that's just how pkg-config rolls. Another option (like the OP mentioned) is to either add the libraries you need "out of band" or to modify sdl2.pc so it includes "all the libraries you need" on the Libs: line (not Libs.static: line which probably already has them).

Again, that's how pkg-config rolls :|

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!