简体   繁体   中英

Statically linking libraries into a library

I'm making a library which I want to link dynamically into projects. This library makes use of pthread, opengl, xlib, xrandr, freetype, glew, jpeg, sndfile, and openal. Currently when I compile the library and try to link it in a program I have to link each of those dependencies individually as well, I want to have all those linked into the library by default. Is this possible?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM