user768417
user768417

Reputation:

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?

Upvotes: 1

Views: 204

Answers (1)

joe
joe

Reputation: 1146

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

Upvotes: 1

Related Questions