c++visual-studio-2013static-librariesconvenience-methods

Making a library of libraries so that the end user doesn't require the original libraries


I am making a library using C++ 11, and my library uses several other libraries, like FreeImage and GLFW. I would like to be able to distribute my library in a way that the end users will not be required to install the other libraries; this will prevent versioning issues and keep life easy.

I am developing using Visual Studio 2013 Pro under windows, although the library code is cross-platform (so I eventually should be able to build versions for OS X and Linux). I am only worrying about getting this working under Windows at the moment.

Currently, I am making a static library and have added the dependant libs to the project in the solution explorer. I can use this library in other projects, but I have to link to the dependant libraries.

I think what I want is called a "convenience library" under Linux, but I am not sure.

This project is intended as an educational resource for my students, and I intend to make it open source and provide both the full project and prebuilt binaries. It would be great if the pre-built binaries didn't require installation of every library I am using; they are all open source projects themselves and freely available, but I can't help but think that rolling everything into one library would be very convenient for the end users.

I've tried looking around on the internet for information on this, but I am drowned in search results for Linux-only solutions (and even then, not necessarily related to my exact problem).

Thank you in advance, ladies and gentlemen.


Solution

  • Try this:

    lib.exe /out:convenience.lib myownlib.lib freeimage.lib glfw.lib
    

    (The filenames are just examples, of course.)