Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

How are libraries typically distributed? Because they have to be compiled with the same compiler under the same settings as the project using it, distributing the .dll, .lib, etc. seems impractical. Is the source code just made available for download?

share|improve this question
    
What language is this? –  Marcie Dec 17 '10 at 15:19
    
@Marcie C++. [These are extra words so I can post a comment.] –  Maxpm Dec 17 '10 at 15:22
add comment

3 Answers

up vote 3 down vote accepted

As you noticed, distributing libraries is impractical... You have to care about the version of the compiler (including Service Packs), the settings used to compile, etc. We used to have 6 different ports for each version of Visual Studio: the most important difference was the Runtime Library used (/ST, /MT or /MD).

But unless you can distribute the source code, you'll have to live with this...

share|improve this answer
add comment

You can distribute the .dll, there's nothing wrong with that. In .NET, when you reference a library it doesn't need to be recompiled, you can just use it as is. Plenty of projects distribute their binaries but not their source.

share|improve this answer
    
Not according to some of the answers on stackoverflow.com/questions/4446620/…. –  Maxpm Dec 17 '10 at 15:20
    
@Maxpm: Ah, yeah, C++ may be different. You will need different version for different platforms, as Justin said in his answer + follow recommendations you got in that SO question. In general, though, there's no requirement to distribute source with libraries. –  Anna Lear Dec 17 '10 at 15:43
add comment

If you are going to distribute Libraries or Applications written in C++, you will need to provide a different binary for each platform you are going to support. For example, Windows, Linux, Mac, etc. You may also need to provide different versions for each architecture, for example 32-bit Windows vs 64-bit.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.