Tuesday, January 4, 2005

How do you distribute your C++ libraries


If you have a nice C++ Library with lots of utility functions, how do you distribute your libraries?

Building a single archie file (library file xxlib.a) does not work, on all platforms. So it is required to build such archives for each platform supported. Thats all?
NO. Thanks to 'flexibility' given to compiler vendors to follow their own Name mangling schemes, your application may not be able to link properly with the library though the library is built for your platform. The library may have a differen name mangling schema than the compiler you are using to build your application. So linking may fail.

Solution: Build your library for all known/supported platforms and Compiler version combinations in the world and distribute. aah, okay, Looks fine.

What if a new compiler version comes up with another name mangling scheme?
Simple, Build an archive with that compiler version for all platforms.

What if a new platform comes up?
Simple, Build an archive for that platforms for all compiler versions.

Does it sound viable to maintain the library?
Is there any alternative? What does commerical vendors do?
Simple. Supply source code. Most vendors do.

Discussion thread at comp.lang.c++.moderated :
Distributing C++ libraries and name mangling

NDTV.com : Fact or Allegation ? Just another twisted title for sensationalism

This is yet another example of NDTV.com’s sensationalism twisted titles. The title says, as if this was a fact, woman made to urinate in pub...