1

我正在制作一个我想动态链接到项目中的库。该库使用 pthread、opengl、xlib、xrandr、freetype、glew、jpeg、sndfile 和 openal。目前,当我编译库并尝试将其链接到程序中时,我还必须单独链接每个依赖项,我希望默认情况下将所有这些依赖项链接到库中。这可能吗?

4

1 回答 1

1

you have to get the .a format binary for those libraries you would like to link statically, and include them when you build your target library. that will do the trick. Normally, third party libraries will also have a .a format along with .so

Please take a look here as well. http://www.yolinux.com/TUTORIALS/LibraryArchives-StaticAndDynamic.html

于 2013-10-03T19:11:24.613 回答